Monday, May 21, 2012

HTML select option control when disabled is not submitted with the form

I have the following HTML code. I need to gray out this control depending on the selection in another client-side control. I do it like so using jQuery:



$('#dropDown1').attr('disabled', 'disabled');


The problem is that this control, if disabled, is not submitted with the form. Is there any way to overcome this?



Again, I need to somehow be able to prevent user from editing control in certain situations (not all the time) but still be able to submit it with the form.



<select name="dropDown1" id="dropDown1">
<option value="1">1</option>
<option value="2">2</option>
</select>




No comments:

Post a Comment