Java Reference
In-Depth Information
}
}
function form_submit()
{
//First check the username
var userValue = $F(“username”);
if (userValue == “”)
{
alert(“Please enter a user name to check!”);
return false;
}
var userParms = new Object();
userParms.username = userValue;
var options = getBasicOptions();
options.onSuccess = checkUsername_callBack;
options.parameters = userParms;
new Ajax.Request(“formvalidator.php”, options);
if (isUsernameTaken)
{
alert(“The username “ + userValue + “ is not available!”);
return false;
}
//Now check the email
var emailValue = $F(“email”);
if (emailValue == “”)
{
alert(“Please enter an email address to check!”);
return false;
}
var emailParms = new Object();
emailParms.email = emailValue;
options.onSuccess = checkEmail_callBack;
options.parameters = emailParms;
new Ajax.Request(“formvalidator.php”, options);
if (isEmailTaken)
{
alert(“I'm sorry, but “ + emailValue +
“ is in use by another user.”);
return false;
}
//If the code's made it this far, everything's good
Search WWH ::




Custom Search