The table monoculture is defined as follows: This input uses the Easyui "Easyui-textbox"
1 < ID= "Addsnumber" style= "width:200px; height:30px;" class = "Easyui-textbox" type = "text" name = "Snumber" data-options = "Required:true, missingmessage: ' Please enter study number '" />
How to set the value:
1 //using the form selector: The code seems to have an exception2 //$ ("Input[name= ' Snumber ')". TextBox (' SetValue ', "22012");3 //using the form selector: code is not an exception but cannot set a value for input4 //$ ("Input[name= ' Snumber ')"). Val ("22012");5 //using the ID selector: Cannot set a value6 //$ ("#addSnumber"). Val ("22012");7 //using the ID selector: You can set a value8$ ("#addSnumber"). TextBox (' SetValue ', "22012");9 //using the ID selector and settext: You can set the valueTen$ ("#addSnumber"). TextBox (' SetText ', "22012");
So: Setting values for Text-box can only use the ID selector to select form elements, and then use the textbox ("SetValue", value); Set the value in the same way;
The same is true for the Get value:
1 var snumber = $ ("#addSnumber"). TextBox (' GetValue ');
Easyui-validatebox setting values or getting values are a little different.
Table monoculture is defined as follows:
1 < ID= "Addsnumber" style= "width:200px; height:30px;" class = "Easyui-validatebox" type = "text" name = "Snumber" data-options = "Required:true, missingmessage: ' Please enter study number '" />
How to get a value:
1 //this way, you can set the value of the2 //$ ("#addSnumber"). Val ("22015");3 //you can set the value4 //$ ("Input[name=snumber]"). Val ("22015");5 //The value cannot be set and the syntax is not an exception6 //$ ("Input[name=snumber]"). TextBox ("SetValue", "22015");7 //The value cannot be set and the syntax is not an exception8 //$ ("Input[name=snumber]"). TextBox ("SetText", "22015");9 //The value cannot be set and the syntax is not an exceptionTen //$ ("#addSnumber"). TextBox ("SetValue", "22015");
So: Validatebox can only set and get values in $ (). Val (), the selector can either use the ID selector or the form selector
Summary: When a FORM element uses Easyui, the textbox and Validatebox set values differently from the way they get the values
Setting a value for Text-box can only use the ID selector to select form elements, use the textbox ("SetValue", Value) or TextBox ("Setext", value) to set the value, using the box ("GetValue") or textbox ("GetText") to get the value;
Set values for Validatebox you can use the ID selector and the form selector, and you can only use Val () to get values and set values.
Easyui-textbox and Easyui-validatebox setting values and getting values