I have a text form that contains a text field as well as a designated ID number that i would like to send over to another page. Would that be possible ?
<form name="cForm" id="cForm">
Comment: <input type="textBox" name="cText" id="cText" />
<input type="button" name="submitCreate" id="submitCreate" value="Create" onclick="showCreate('.$row['ID'].')" /><br>
</form>
<script>
function showCreate(str) {
if (str=="") {
document.getElementById("showCreate").innerHTML="";
return;
}
if (window.XMLHttpRequest) {
// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
} else { // code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function() {
if (xmlhttp.readyState==4 && xmlhttp.status==200) {
document.getElementById("showCreate").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("Post","showCreate.php?q="+str,true);
xmlhttp.send();
}
</script>
i would like to get the value of the text field and ID in separate variables as such
$comment = $_REQUEST["q"];
$ID = $_REQUEST["p"];