I have a checkbox that, given certain conditions, needs to be disabled. It turns out HTTP doesn't post disabled inputs. How can I get around that?
Ad blocker detected: Our website is made possible by displaying online advertisements to our visitors. Please consider supporting us by disabling your ad blocker on our website.
If coding is more your thing then the Website Development & Scripting forums are for you. Share server-side scripting and database integration tips, tricks and problems here.
To get "readonly" look and POST checkbox's value at the same time, just add a hidden "input" with the same name and value as your checkbox. You have to keep it next to your checkbox or between the same <form></form> tags:
Also, just to let you know readonly="readonly", readonly="true", readonly="", or just READONLY will NOT solve this!
Code: Select all
<input type="checkbox" checked="checked" disabled="disabled" name="Tests" value="4">YOUR TEXT</input> <input type="hidden" id="Tests" name="Tests" value="4" />
Users browsing this forum: No registered users and 0 guests