Java Reference
In-Depth Information
<input type="submit" value="Submit" />
</td>
<td />
</tr>
</table>
</form>
<script src="prototype.1.7.2.js"></script>
<script>
function checkUsername(e) {
e.preventDefault();
 
var userValue = $("username").value;
 
if (!userValue) {
alert("Please enter a user name to check!");
return;
}
 
var options = {
method: "get",
onSuccess: handleResponse,
parameters: {
username: userValue
}
};
 
new Ajax.Request("ch14_formvalidator.php", options);
}
 
function checkEmail(e) {
e.preventDefault();
 
var emailValue = $("email").value;
 
if (!emailValue) {
alert("Please enter an email address to check!");
return;
}
 
var options = {
method: "get",
onSuccess: handleResponse,
parameters: {
email: emailValue
}
};
 
new Ajax.Request("ch14_formvalidator.php", options);
}
 
function handleResponse(transport) {
var response = transport.responseJSON;
 
if (response.available) {
alert(response.searchTerm + " is available!");
Search WWH ::




Custom Search