I need to pass a URL to a JavaScript function something like the following.
<script type="text/javascript" language="javascript">
var xmlhttp='';
function ajax()
{
if(window.XMLHttpRequest)
{
xmlhttp=new XMLHttpRequest();
}
else
{
xmlhttp = new ActivexObject("Microsoft.XMLHTTP");
}
}
function someFunction(orders_per_page, url)
{
ajax();
var val=document.getElementById("txt_order_amount").value;
xmlhttp.onreadystatechange=function()
{
if(xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("list").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET",url, true);
xmlhttp.send();
}
</script>
<select
id="cmb_page" name="cmb_page"
onchange="someFunction(this.value, "reports/OrderAmount.php?val="+val+"&orders_per_page="+orders_per_page+"&pageNo="+getSelectedPage();">
<option value="1">Some Value</option>
</select>
I need to pass a URL string as mentioned on the onchange
even of the <select><option></option></select>
element. Is it possible?