if jquery has no 'readonly' on 'select' and 'checkbox'? -
i can't find function readonly on 'select' , 'checkbox'. 'disable 'seems option variable no longer exist. fix them out by:
$('input[type=checkbox]').each(function(){ if ( $( ).prop( "checked" ) ){ $(this).change(function() { $(this).prop('checked', true); }); } else{ $(this).prop("disabled", true); } }); $('select option:not(:selected)').prop("disabled", true);
they seems ok , may leave 1 choice want , others disabled.
are there other options?
there disabled
checkboxes , selects. because readonly
prevents user changing value of input , not interacting , changing state of input.
with checkboxes , select input change state instead of value , readonly has no effect.
so should use disable
instead. still submit values can use hidden field contains value want submit , display disabled
checkbox user let him know there.
Comments
Post a Comment