trickydicky
02-14-2010, 11:46 AM
im not 100% sure if this is the right place to post this, so apologies if not..
I have a modal popup which im using to insert a row into a table asynchronously. I have a button that fires off the INSERT statement. The difficulty im having is that once ive done the aysnch call i want the popup to remain visible but it disappears automatically. Has anyone come across this or have any idea how i can force the popup to remain displayed?? My codes below..
function AddRow() {
var NewRowVar = document.getElementById('NewRowValue').value;
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
var queryString = "?row=" + NewRowVar;
xmlhttp.onreadystatechange=function()
{
if(xmlhttp.readyState==4)
{document.getElementById('TextAreaDIV').innerHTML=xmlhttp.responseText}
}
xmlhttp.open("GET","Includes/newRow.php" + queryString,false);
xmlhttp.send(null);
var promptvar = document.getElementById("AddPROMPT");
promptvar.style.display = "block";
}
I figured that last two lines at the end would force the prompt to be visible buts its like the whole page is refreshing or something. Any ideas? Im stumped!
I have a modal popup which im using to insert a row into a table asynchronously. I have a button that fires off the INSERT statement. The difficulty im having is that once ive done the aysnch call i want the popup to remain visible but it disappears automatically. Has anyone come across this or have any idea how i can force the popup to remain displayed?? My codes below..
function AddRow() {
var NewRowVar = document.getElementById('NewRowValue').value;
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
var queryString = "?row=" + NewRowVar;
xmlhttp.onreadystatechange=function()
{
if(xmlhttp.readyState==4)
{document.getElementById('TextAreaDIV').innerHTML=xmlhttp.responseText}
}
xmlhttp.open("GET","Includes/newRow.php" + queryString,false);
xmlhttp.send(null);
var promptvar = document.getElementById("AddPROMPT");
promptvar.style.display = "block";
}
I figured that last two lines at the end would force the prompt to be visible buts its like the whole page is refreshing or something. Any ideas? Im stumped!