A have a form that contains several fields, one of these is a dropdown with three options (3,2,1) and a checkbox. I am using javascript to tick the checkbox if the value '1' is selected in the dropdown
This works fine. HOWEVER
I need to show the checkbox on the website but not allow the value to be changed. To do this I am using 'disabled' in my input html
When '1' is selected in the dropdown the checkbox is ticked and the checkbox is greyed out preventing the user form changing the value, BUT when I submit the form the value of '1' isn't being passed. If I remove 'disabled' the value gets passed without a problem.
Can I have the checkbox disabled but the avlue to be sent on submit of the form?
Thanks
Code:
document.myform.redflag.checked = (control.value=="1")? true : false;
This works fine. HOWEVER
I need to show the checkbox on the website but not allow the value to be changed. To do this I am using 'disabled' in my input html
Code:
<input type='checkbox' value='1' disabled />
When '1' is selected in the dropdown the checkbox is ticked and the checkbox is greyed out preventing the user form changing the value, BUT when I submit the form the value of '1' isn't being passed. If I remove 'disabled' the value gets passed without a problem.
Can I have the checkbox disabled but the avlue to be sent on submit of the form?
Thanks