Radio Value Acquisition
$ ("input[type= ' Radio ']:checked"). Val ();
2, sets the specified item as the currently selected item
$ ("input[type= ' Radio ')"). EQ (1). attr ("Checked", true);//Set the second item to be selected
<input type= "text" name= "Textname" id= "text_id" value= "" >
<!--the rest please add it yourself. It is important to have TYPE.NAME.ID and so on, the general situation these are some--
2. Below to see how to obtain the various values in the form and so on;
function Get_form_value () {
/ * Get the value of Text.areatext * /
var textval = $ ("#text_id"). attr ("value");//or
var textval = $ ("#text_id"). Val ();
/ * Get the value of the radio button * /
var Valradio = $ ("input[@type =radio][@checked]"). Val ();
/ * Get the value of the check box * /
var checkboxval = $ ("#checkbox_id"). attr ("value");
/ * Get the value of the drop-down list * /
var selectval = $ (' #select_id '). Val ();
}
3. Additional processing of the form:
//Control form elements:
//text box, text area:
$ ("#text_id"). attr ("Value", "");//Clear Contents
$ ("#text_id"). attr ("value", ' test ');//fill content
//Multi marquee checkbox:
$ ("#chk_id"). attr ("Checked", "");//Unchecked Value
$ ("#chk_id"). attr ("Checked", true);//The selected value
if ($ ("#chk_id"). attr (' checked ') ==undefined)//Determine if selected
//Radio Group radio:
$ ("input[@type =radio]"). attr ("Checked", ' 10 ');//The radio button setting value=10 is the current selection
//drop-down box select:
$ ("#select_id"). attr ("value", ' test ');//Set Value=test item as the current selection
$ ("<option value= ' test ' >test</option><option value= ' test2 ' >test2</option>"). AppendTo ("#select_id")//option to add a drop-down box
$ ("#select_id"). empty ();//Empty drop-down box