I am passing value to AJAX function, but always shows undefined..
It works fine two days ago, but not today..
Checkbox
<input type="checkbox" onclick="[B]disablebatch()[/B]; selectinactivecourse(this.checked); " id="inactive_check" name="inactive_check" <?php if(isset($_POST['inactive_check'])) echo "checked";?>>
Combobox
<select id="course" name="course" style="width:145px" onchange="selectBatch1(this.value, document.myform.inactive_batch.value);"> // [U]Where I am passing Checkbox's value[/U]
<select id="course" name="course" style="width:145px" onchange="selectBatch1(this.value, document.myform.inactive_batch.checked);"> // [U]Also not working[/U]
function disablebatch()
{
if(document.myform.inactive_check.checked)
{
document.myform.inactive_batch.value=1;
document.myform.inactive_batch.disabled=true;
document.myform.batch.disabled=true;
alert(document.myform.inactive_batch.value);
}
else
{
document.myform.inactive_batch.value=0;
document.myform.inactive_batch.disabled=false;
document.myform.batch.disabled=false;
alert(document.myform.inactive_batch.value);
}
}
function selectBatch1(str, str1)
{
var v=str1; // [B]str1 value is undefined[/B]
xmlhttp1=GetXmlHttpObject1();
if (xmlhttp1==null)
{
alert ("Your browser does not support AJAX!");
return;
}
var url="selectBatch.php";
url=url+"?c="+str;
url=url+"&action=misrpt";
if(v==undefined || v==true)
url=url+"&val=0";
else
url=url+"&val=1";
xmlhttp1.onreadystatechange=stateChanged1;
xmlhttp1.open("GET",url,true);
xmlhttp1.send(null);
}