Hi to all,
I am new to Ajax. I have a application form. which has a edit option of the previous record of a user.
when a user select the date at which he wants to edit the records.then the ajax function calls performs the operation and gives the result...its all working properly...but the ajax response is dispalyed in only in text box not in drop down list...please help me around this..
Ajax code is
It is displayed in the input box
Not in Drop down box
I am new to Ajax. I have a application form. which has a edit option of the previous record of a user.
when a user select the date at which he wants to edit the records.then the ajax function calls performs the operation and gives the result...its all working properly...but the ajax response is dispalyed in only in text box not in drop down list...please help me around this..
Ajax code is
Code:
function ajaxFunction()
{
var student_id=document.frmMedicaldetail.student_id.value;
var grade=document.frmMedicaldetail.grade.value;
var ajaxRequest; // The variable that makes Ajax possible!
try
{
ajaxRequest = new XMLHttpRequest();
}
catch (e)
{
try{
ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
try{
ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e)
{
alert("Your browser broke!");
return false;
}
}
}
ajaxRequest.onreadystatechange = function()
{
if(ajaxRequest.readyState == 4)
{
var ajaxDisplay = ajaxRequest.responseText;
//document.frmMedicaldetail.edit_age.value = edit_sick;
data = ajaxDisplay.split ( "<br/>" );
document.frmMedicaldetail.age.value = data[0];
}
}
var edit_date = document.getElementById('edit_date').value;
if(grade!="" && student_id!="" && edit_date!="")
{
var queryString = "?grade=" + grade + "&student_id=" + student_id + "&edit_date=" + edit_date;
ajaxRequest.open("POST","sick_ajax.php"+queryString,true);
ajaxRequest.send(null);
}
}
Code:
<input type='text' name='age' value=''>
Comment