开发者

Problems with drop down list disabling

开发者 https://www.devze.com 2023-04-05 20:58 出处:网络
I have two drop-down select lists in my form as well as a textarea box. The problem I am having is that, one a user creates a record, the record is then updated by another group but what I want to do

I have two drop-down select lists in my form as well as a textarea box.

The problem I am having is that, one a user creates a record, the record is then updated by another group but what I want to do, is prevent the other group from updating both select lists as well as the textarea box. I have disabled these items but when the user attempts to submit the form again, it looks like these items are not being posted and looks like the values are NULL.

I am using jQuery:

   $('#DROP-DOWN1').attr("disabled", "disabled").addClass('itemDisabled');
   $('#DROP-DOWN1').attr("disabled", "disabled").addClass('itemDisabled');
   $('#TEXT-AREA').attr("disabled", "disabled").addClass('itemDisabled');

How I can p开发者_高级运维revent the user from modifying these items above but at the same time having the values posted?


Nice problem!

Can you hide them instead of disabling? Set visiblity to false


Another solution is to copy the values to an hidden input field. That one will get posted!

Work forward with this in mind: http://jsfiddle.net/uHQkx/


Instead of disabled try readonly.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号