mardi 27 septembre 2016

Make a jquery mobile checkbox not clickable

So i am using jquery mobile and i have a checkbox and label in a form like so :

<form class="myForm">
  <label><input checked name="myCheckBox" id="myCheckBox" onclick="return false;" onkeydown="return false;" type="checkbox">Checking</label>
</form>

Now comes my question: How can i make the checkbox readonly ? So the user can click on it but it wont change its state? I dont want to use the disabled option!

NOTE: Before you mark it as a duplicate ive searched for answers and could only find solutions using none jquerymobile checkboxes. They solved it with: onclick="return false" which is not working... in jquerymobile you can test it with this fiddle. If you remove the external resources onclick="return false" is working.




Aucun commentaire:

Enregistrer un commentaire