input is set to disabled, unable to submit the form background Solution

<input name="country" id="country" size=12 value="disabled提交时得不到该值 " disabled="disabled" >
In form after form submission can not get the value. 
= The Disabled " Disabled " to = Readonly " Readonly " can, according to the W3C specifications
 
The input is set to disabled will have the following restrictions: 
1 can not receive focus 
2 will be skipped when using the tab key 
3. may not be successful in 
 
Readonly set of input will have the following restrictions: 
1. can receive focus but can not be modified 
2. You can use the tab key to navigate 
3. may be successful in 
Only successful form elements are valid data, that can be submitted. disabled and readonly text input box can only be modified by a script property value. 
 
First, take a look at the difference between these two attributes in effect and use
 
1 readonly to lock the controls, he can not be modified by the interface (but can be modified by him javascript).
 
2 disabled and readonly same place also can lock this control user can not change his value, but the disabled more thorough Some, he is to make you totally can not use him, including changing his background color (do not believe, you go to modify a the disabled out of the input text box, you find that you are in vain), if the checkbox is not checked him.
 
3 All controls are disabled attribute, but not necessarily readonly attributes, such as select drop-down box.
(1)text
 
 
(2) checkBox
 
 
(. 3) select the pull-down selection box (here only shows disabled and non-disabled distinction because readonly attribute select no
 
 
(4) button button
 
 
Description: Click on the button readonly out can still trigger event, but was disabled off button can not be used with or without the above events.
 
(5)div
 
 
Description: The property after div setting disabled, the entire div are grayed out, but there is still a text box to enter the content.
Note: select the drop-down selection box is not readonly attribute

Guess you like

Origin www.cnblogs.com/niuben/p/11433577.html