Giter VIP home page Giter VIP logo

readonly.js's People

Contributors

codebaboon avatar haggen avatar yogster avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

readonly.js's Issues

Update sham when the input is changed via JavaScript

Suggest add on change event:
$('input').on('change, function() { // update corresponding hidden value of input with same name $('input:hidden[data-sham="'+ $(this).name +'"]').val(''); })

in case the value is programmatically changed.
e.g. $('select').val('changed value').trigger('change')

jQuery Serialize and readonly.js

Hi Corenzan,

Looking to readonly.js, when used with select, you turn them readonly creating an input with the same name attribute than the select.

When serializing, jQuery do it using the name attribute for select, so instead having no value (serializeArray don't get value when the element is disabled), you get the value from this hidden input.

But when user change select value when select element is disabled, identifiying the select by value (in case of programmaticaly change without direct user interaction), then it turns that this hidden input is not update.

The idea would perhaps to set a trigger that update this hidden input value when the select value is modified on readonly mode.

What do you think ?

Unchecked Checkboxes with values, behave like checked checkboxes

If we have something like the following:

<input type="checkbox" name="something" value="1" />
...
if( isset( $_POST['something'] ) && '1' === $_POST['something'] ) {
//checkbox was checked
}

setting the checkbox to readonly will result in a hidden input being created with value="1". In the above example this will result in the assumption that the checkbox was checked whether or not it actually was. I assume the same would be true for type=radio.

The workaround I applied was to add the following to line 13 of the script

if(target.type === 'checkbox' && ! target.checked){
return;
}

Can make it editable after being readonly

Im using jquery 2.0.3 and trying to use this functionality in order to make a select (second element) readonly if a certain value of a select (first element) option is chosen or editable if another option is chosen with the same select element. But I couldnt make it work correctly. It turns readonly in the right way but can make it editable after beeing readonly

Dist has incorrect logic in jquery section

entryPoint(_this, value);

The call to entryPoint in the dist version of the code differs from the src version in a way that actually is broken. By passing in _this the dist version is supplying a jQuery object as the target, which does meet the valid argument requirements and so throws the invalid argument error.

The dist file should be updated to reflect the correct logic found in the src version of the code.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.