If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Ajax Not Responding Properly In Asp Page

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-26-08, 00:20
DBA_Rahul DBA_Rahul is offline
Registered User
 
Join Date: May 2004
Location: bangalore
Posts: 270
Ajax Not Responding Properly In Asp Page

Hi Guys,
I am having problem with AJAX script in my ASP page.

Quote:
<script type="text/javascript">
function ajaxFunction()
{
var xmlHttp;
var isValid;

try
{
// Firefox, Opera 8.0+, Safari
xmlHttp=new XMLHttpRequest();
}
catch (e)
{
// Internet Explorer
try
{
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
try
{
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e)
{
alert("Your browser does not support AJAX!");
return false;
}
}
}
xmlHttp.onreadystatechange=function()
{
if(xmlHttp.readyState==4)
{
document.frmPasswordResetHome.Validation_Message.v alue=xmlHttp.responseText;
}
}
var url;

url = "UpdateRegistrationValidation.asp?txtEmployeeID_Up date_Reg=" + document.frmPasswordResetHome.txtEmployeeID_Update _Reg.value + "&Session_ActionDomainLoginName=" + document.frmPasswordResetHome.Session_ActionDomain LoginName.value;

xmlHttp.open("GET",url,true);
xmlHttp.send(null);

isValid = document.frmPasswordResetHome.Validation_Message.v alue;

//alert(isValid);

if (isValid == "True")
alert("True");
else
alert("False");
}
</script>
And the code in UpdateRegistrationValidation.asp file is as follows
Quote:
<%
Response.Write "True"
%>

Now lemme tell ya that the problem I am facing. I always get the alert message as "False" for the 1st time. But from the second time I always get the "True" message.

I also found that the text field "Validation_Message" gets filles with the value "True", quite late.

Any one can please help me on this.


Thanks,
Rahul Jha
__________________
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On