Java Reference
In-Depth Information
</tr>
<tr>
<td colspan="2" class="submit">
<input type="submit" value="Submit" />
</td>
<td />
</tr>
</table>
</form>
<script src="mootools-core-1.5.1-compressed.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 = {
url: "ch14_formvalidator.php",
data: {
username: userValue
},
onSuccess: handleResponse
};
 
new Request.JSON(options).get();
}
 
function checkEmail(e) {
e.preventDefault();
 
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: handleResponse
};
 
new Request.JSON(options).get();
}
 
function handleResponse(data, json) {
if (data.available) {
Search WWH ::




Custom Search