When I send variable using following ajax function, num and value both variable gets num variable value only. How could I pass different values. Can anyone help me?
<script>
function calculate_rate(num,value)
{
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("costing").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET","data.php?num="+num+"&value="+value,true);
xmlhttp.send();
}// showHint
</script>
<span id="costing"></span>
<form>
<label>Number</label>
<span>
<select name="num" onchange="calculate_rate(this.value)">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select><br />
</span>
<label>Value</label>
<span>
<input type="text" name="value" value="" onchange="calculate_rate(this.value)" />
</span>
</form>