javascript - RemoveAttr doesn't remove disabled -
<input type="checkbox" name="checking">j'accepte les conditions <input type="submit" value="valider" id="valide" disabled/> <script> $(document).ready(function(){ if((input=$("input:checkbox[name=checking]").is(":checked"))){ $("#valide").prop('disabled',true); } }); </script>
hi, want enable button (valide) when checked checkbox
you must add listener check box call function every time when user check or uncheck
try sloution :)
<input type="checkbox" onclick="check()" name="checking">j'accepte les conditions <input type="submit" value="valider" id="valide" disabled/> function check(){ if($('input[name=checking]').is(":checked")){ $("#valide").prop('disabled',false); }else{ $("#valide").prop('disabled',true); } }
please sure add javascript code after html code
demo click here
Comments
Post a Comment