Joe9999999
05-30-2006, 03:18 PM
I am doing a non PHP AJAX request to my server. The request works perfectly and I return the expected value. When I put the response in my div for display, it displays for 1 second and disappears. How I populate the div is below. Does anyone know why my value would not stay displayed?
<script>
function Send_AJAX_Request(target)
{
// pass the query the user has typed
// Also, pass the id for a div to update, and the function to call to update this div.
var user = document.getElementById("Text1").value;
var pw = document.getElementById("Text2").value;
var myurl = "verifymember.pgm";
myurl +="?username=" + escape(user) + "&password=" + escape(pw);
mydiv = document.getElementById("notauthorized_div");
// Fire request for data and populate div:
AJAX_Update(myurl, mydiv, Receive_AJAX_Response);
}
// Called from inside the function AJAX_Update:
function Receive_AJAX_Response(mydiv, response )
{
// Display the div at the proper position
mydiv.innerHTML = response;
setRespDiv(mydiv);
}
</script>
<form name="frmSignin">
<div style="width:194px;">
<div id="signinboxtop"><img src="/art/signin-box-top.gif" width="194" height="7" /></div>
<div id="signinboxmiddle"> <span class="plaintext"><strong>User Name</strong>
</span><br />
<input type="text" name="username" value="" maxlength="10" ID="Text1" />
<br />
<br />
<span class="plaintext"><strong>Password</strong></span><br />
<input type="password" name="password" value="" maxlength="10" ID="Text2" />
</div>
<div id="signinboxbottom">
<input name="image" type="image" src="/art/signin-box-bottom.jpg" width="194" height="32" onclick="Send_AJAX_Request(this);">
</div>
</div>
<div id="notauthorized_div" style="width:498px;"></div>
<script language="JavaScript">
<!--
document.frmSignin.username.focus();
//-->
</script>
</form>
Also this url changes after AJAX request: https://mypage/member-log-in.htm
to: https://mypage/member-log-in.htm?username=test&password=testa&image.x=55&image.y=13
Where would (&image.x=55&image.y=13) come from? Is this the problem?
<script>
function Send_AJAX_Request(target)
{
// pass the query the user has typed
// Also, pass the id for a div to update, and the function to call to update this div.
var user = document.getElementById("Text1").value;
var pw = document.getElementById("Text2").value;
var myurl = "verifymember.pgm";
myurl +="?username=" + escape(user) + "&password=" + escape(pw);
mydiv = document.getElementById("notauthorized_div");
// Fire request for data and populate div:
AJAX_Update(myurl, mydiv, Receive_AJAX_Response);
}
// Called from inside the function AJAX_Update:
function Receive_AJAX_Response(mydiv, response )
{
// Display the div at the proper position
mydiv.innerHTML = response;
setRespDiv(mydiv);
}
</script>
<form name="frmSignin">
<div style="width:194px;">
<div id="signinboxtop"><img src="/art/signin-box-top.gif" width="194" height="7" /></div>
<div id="signinboxmiddle"> <span class="plaintext"><strong>User Name</strong>
</span><br />
<input type="text" name="username" value="" maxlength="10" ID="Text1" />
<br />
<br />
<span class="plaintext"><strong>Password</strong></span><br />
<input type="password" name="password" value="" maxlength="10" ID="Text2" />
</div>
<div id="signinboxbottom">
<input name="image" type="image" src="/art/signin-box-bottom.jpg" width="194" height="32" onclick="Send_AJAX_Request(this);">
</div>
</div>
<div id="notauthorized_div" style="width:498px;"></div>
<script language="JavaScript">
<!--
document.frmSignin.username.focus();
//-->
</script>
</form>
Also this url changes after AJAX request: https://mypage/member-log-in.htm
to: https://mypage/member-log-in.htm?username=test&password=testa&image.x=55&image.y=13
Where would (&image.x=55&image.y=13) come from? Is this the problem?