/* Set the value of the form */function setValue (name, value) { var first = name.substr (0, 1), input, i = 0, val;
if (Value = = = "") return
; if ("#" = = = First | | "." = = = First ) { input = $ (name);} else {input = $ ("[name= '" + name + "']");} if (Input.eq (0). I S (": Radio")) {//radio button Input.filter ("[value= '" + Value + "']"). each (function() {this.checked = True });} else I F (Input.eq (0). Is (": checkbox")) {//check box if (! $.isarray (value)) {val = new Array (); val[0] = value;} else {val = value;} for (i = 0, Len = val.l Ength; i < Len; i++) {input.filter ("[value= '" + val[i] + "']"). each (function() {this.checked = True });}} else {//other forms The option directly sets the value input.val (value);}}
Call method :setValue (' can find the condition of input box ', ' {Output database field |default= ' 0 '} ');
JS Set the selected value of the input box