HTML page:
<div class= "Fileradio" >
<input type= "Radio" name= "Sex" id= "boy" value= "0" ><p> male </p>
<input type= "Radio" name= "Sex" id= "Gil" value= "1" ><p> women </p>
</div>
<div class= "Fileannpas" >
<select class= "Phonttype" name= "Phonttype" id= "Patientcardtype" >
</select>
</div>
Js:
The Ajax Pass ID returns the data for that bar ID
if (data.data.patient_sex==0) {
$ ("#boy"). attr (' checked ', ' checked ');
}else{
$ ("#gil"). attr (' checked ', ' checked ');
}
$ ("#patientCardType selected:"). Val (Data.data.CARD_TYPE);
Get Radio Value:
var sex=$ ("input[type= ' Radio ']:checked"). Val ();
Gets the value of the select:
var cardtype=$ ("#patientCardType"). Val ();
Gets the HTML value of the select:
var cardname=$ ("#patientCardType option:selected"). html ();
Radio button radio and drop-down select Select,ajax return data echo corresponding value