Since I don't have enough points to leave a comment, I must ask a question. The situation I'm referencing can be seen here LINK. And I promise that I've Googled for hours before posting a question.
I'm trying to be able to "toggle" HTML checkboxes to be readonly. Here is where I am so far.
- "DISABLED" is NOT an option. It won't post with the form.
- "READONLY" is NOT really readonly. It may gray-out, but it can still be clicked.
- The only thing that seems to work is what the LINK refers to and that is applying READONLY to the checkboxes and then some jQuery like:
$(':checkbox[readonly=readonly]').click(function(){return false;});
or$(':checkbox[readonly=readonly]').click(function(){return true;});
- I've also messed around with swapping classes in case there was something limiting about the readonly attribute.
THE PROBLEM is that whatever the first setting becomes (TRUE or FALSE) is what it stays like until the page is refreshed. I can't re-enable the checkboxes simply by running the other statement to return the opposite (FALSE or TRUE).
QUESTIONS
- Is there a way to be able to toggle the RETURN (TRUE or FALSE) for the .click event?
- Is there another alternative for toggling the ability to check the checkboxes?
Thanks a bunch.