In my web page I want to pass two veriables to another page. I use this code for it
function getStData(key) {
var gender=document.getElementById("gender").value;
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
var res = this.responseText;
document.getElementById("std_table").innerHTML = res;
}
};
xhttp.open("GET", "../../lib/HOS_AddMain.php?key="+key+"&gender="+gender, true);
xhttp.send();
}
In the body:
<body onload="getStData('')">
<input type="radio" name="gender" id="gender" checked="checked" onchange="getStData(document.getElementById('searchIn').value)" ="" value="male" /> Male
<input type="radio" name="gender" id="gender" value="female"> Female
how can i implement it on radio button click and show the particular information?