Hello,
I am trying to get the element of an option, but seems my code is not working:
<script type="text/javascript">
/*<![CDATA[*/
function reportsendipp()
{
if (window.XMLHttpRequest)
{
xmlhttp=new XMLHttpRequest();
}
else
{
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
;
}
}
xmlhttp.open("GET","report_member.php?report=" + document.getElementById("ipps").value + "&&member=" + document.getElementById("track").value, true);
xmlhttp.send();
}
/*]]>*/
</script>
<form style="display: none" id="ipp" action="">
<select id="ipps" name="report_ipp">
<option value="-1">Choose a type</option>
<option value="1"> Report Test One</option>
<option value="2"> Report Test Two</option>
<option value="3"> Report Test Three</option>
</select>
<input onclick="reportsendipp()" type="button" value="Report" /> <input onclick="cancelreportipp()" type="button" value="Cancel" />
</form>
<div><input style="display: none" id="track" value="15" /></div>
What i need to do is, when i choose let's say option number 2, string be sent as reported_member.php?report=2&&member=15
Any help is appreciated.
Thank you in advance :)