Hi
First, if your callback function (ReturnCheckUser) sets a global JS
variable then any other code can read it.
Second, if you set "DWREngine.setAsync(false);" before calling
"_execute" (so the _execute() call will be synchronous, meaning, it will
wait) then the global variable set in the previous step will be
available to the CheckUserSettings function and you can do what you want
with it there.

        Mark


-----Original Message-----
From: Chad McCue [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, January 31, 2007 2:31 PM
To: CF-Talk
Subject: cfajax

I am running the following code to check if a username exists.
 
function CheckUsersettings() {
//Check to see if the username is already taken using AJAX
TheUsername = document.ProfileStep1Form.Username.value;   
     
DWREngine._execute(_cfscriptLocation, null, 'FindUsername', TheUsername,
ReturnCheckUser); // Is there any way this can return a value from the
called ReturnCheckUser function
 
}
 
//My "Continue" button on my form calls the CheckUsersettings function
for other required fields and then proceeds to check if the username
exists. I need to somehow submit the form if it does not exist but stop
the form if it does exist.
 
 
function ReturnCheckUser(productArray) {
    
  var key = Array();
  key[0] = productArray[0]['KEY']; 
 
  if(key[0] == 0) {    
 document.ProfileStep1Form.submit();  // This is not working only
getting a error saying "document.ProfileStep1Form.submit(); is not  a
function"
   //return true;
  }
  else {   
   alert("The username entered is already taken.\n\n Please try
again.");
   return false;
  }
 }

   
 
Chad McCue
[EMAIL PROTECTED]
 




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Upgrade to Adobe ColdFusion MX7 
Experience Flex 2 & MX7 integration & create powerful cross-platform RIAs 
http:http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:268262
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to