I have a input checkbox that is checked and disabled when some JS runs on page load.
<input name="selectUnionDues" id="selectUnionDues" type="checkbox" checked="checked" runat="server" />
When I get the value of the checkbox by using (on the server side)
this.selectUnionDues.checked //returns false
I always get a false
EDIT: I am concerned about using heavy asp.net controls since the page size in this application needs to be low. Is there a way out using HTMl controls?
Disabled form controls are not "successful controls", that means they values aren't "submitted" at all with your form.
check this out https://web.archive.org/web/20211020150718/https://www.4guysfromrolla.com/articles/012506-1.aspx
In short, (1)there is a "SubmitDisabledControls" property of "form" or (2)tweak the javascript the author provided
If you disable the checkbox, it always return false.
the best idea is to make the checkbox readonly, so that it will return the value as it is.
make the readonly="readonly"
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With