Determine the value of 3 radios to the textbox (' #SELLPRICE '). val (num);
function TZ () {//radio Event
var radios = Document.getelementsbyname ("C_index1");
var num = $ (' #one '). Val ();
if (radios[0].checked = = True) {
$ (' #DISCAMT '). val (num);//value
} else if (radios[1].checked = = True) {
$ (' #DISCPERC '). val (num);//value
/* Alert ($ (' #DISCPERC '). Val (num)); */
} else if (radios[2].checked = = True) {
$ (' #SELLPRICE '). val (num);//value
Test
var nn=$ (' #SELLPRICE '). Val ();//value
Alert (nn+ "+3");
}
}
In jquery, if you get the value of the Radio-web development/ajax that is selected in the three radio:
<script src= "Js/jquery-1.3.2.js" ></script>
<script type= "Text/javascript" >
function doit () {
Alert ($ ("Input[name= ' rad ']:checked"). Val ());
}
</script>
<input id= "rad" Name= "Rad" type= "Radio" value= "1"/>
<input id= "rad" Name= "Rad" type= "Radio" value= "2"/>
<input id= "rad" Name= "Rad" type= "Radio" value= "3"/>
<input type= "button" onclick= "doit ()" value= "click" >
jquery is judged by value as the number of methods ":
<script type= "Text/javascript" >
if ($ (' #singlePrt '). val () = = "TRUE") {
$ (' input[name=singleprt] '). Get (0). checked = true;
}else{
$ (' input[name=singleprt] '). Get (1). checked = true;
}
</script>
<body>
<input name= "SINGLEPRT" type= "Radio" id= "Singleprt" value= "${Ks.singleprt}" > Single fly
<input name= "SINGLEPRT" type= "Radio" id= "Summary" value= "FALSE" > Fly
</body>
Use of the radios control