Java Reference
In-Depth Information
};
new Request.JSON(options).get();
}
function checkEmail() {
var emailValue = $("email").value;
if (!emailValue) {
alert("Please enter an email address to check!");
return;
}
var options = {
url: "ch14_formvalidator.php",
data: {
email: emailValue
},
onSuccess: handleEmailResponse,
onFailure: handleError
};
new Request.JSON(options).get();
}
function handleUsernameResponse(response) {
if (!response.available) {
alert("The username " + response.searchTerm +
" is unavailable. Try another.");
return;
}
checkEmail();
}
function handleEmailResponse(response) {
if (!response.available) {
alert("The email address " + response.searchTerm +
" is unavailable. Try another.");
return;
}
document.theForm.submit();
}
function handleError() {
alert("A network error occurred. Please try again " +
"in a few moments.");
}
$("btnSubmit").addEvent("click", btnSubmitClick);
</script>
Search WWH ::




Custom Search