J
jr
Is the code right? It is my first XMLHTTP. I am getting the id var
passed from php but I'm not sure about the nationalDrugCode var.
I have a question, even if I didn't get the value passed from php on
the ndc, it should echo get1 as id without the rest right? I'm not
getting anything echoed from the second alert. Is everything okay
with the SaveThisRecord dialog? If all goes well I just want it to run
the UPDATE php script to update the mysql db with the nationalDrugCode
value of the row with the record id of the id?
thanks,
<script type="text/javascript">
function saveRecord(id) {
alert(id);
var answer=confirm("Save this record?")
if(!answer){return;}
get1="id="+id;
get1+="&nationalDrugCode="+document.getElementByID("nationalDrugCode"
+ id).value;
alert(get1);
if ( window.XMLHttpRequest ) {// code for IE7+, Firefox, Chrome,
Opera, Safari
xmlhttp=new XMLHttpRequest();
}else{ // code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.open("GET","saveRecord.php?" + get1,true);
xmlhttp.send();
}
passed from php but I'm not sure about the nationalDrugCode var.
I have a question, even if I didn't get the value passed from php on
the ndc, it should echo get1 as id without the rest right? I'm not
getting anything echoed from the second alert. Is everything okay
with the SaveThisRecord dialog? If all goes well I just want it to run
the UPDATE php script to update the mysql db with the nationalDrugCode
value of the row with the record id of the id?
thanks,
<script type="text/javascript">
function saveRecord(id) {
alert(id);
var answer=confirm("Save this record?")
if(!answer){return;}
get1="id="+id;
get1+="&nationalDrugCode="+document.getElementByID("nationalDrugCode"
+ id).value;
alert(get1);
if ( window.XMLHttpRequest ) {// code for IE7+, Firefox, Chrome,
Opera, Safari
xmlhttp=new XMLHttpRequest();
}else{ // code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.open("GET","saveRecord.php?" + get1,true);
xmlhttp.send();
}