Java Reference
In-Depth Information
PHP
PHP is a popular open source server-side scripting language and must be installed on your computer if
you wish to run PHP scripts. You can download PHP in a variety of forms (binaries, Windows installation
wizards, and source code) at www.php.net. The PHP code used in this example was written in PHP 5.
Try It Out XMLHttpRequest Smart Form
Open your text editor and type the following:
<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01//EN”
“http://www.w3.org/TR/html4/strict.dtd”>
<html>
<head>
<title>Form Field Validation</title>
<style type=”text/css”>
.fieldname
{
text-align: right;
}
.submit
{
text-align: right;
}
</style>
<script type=”text/javascript” src=”httprequest.js”></script>
<script type=”text/javascript”>
function checkUsername()
{
var userValue = document.getElementById(“username”).value;
if (userValue == “”)
{
alert(“Please enter a user name to check!”);
return;
}
var url = “formvalidator.php?username=” + userValue;
var request = new HttpRequest(url, checkUsername_callBack);
request.send();
}
function checkUsername_callBack(sResponseText)
{
var userValue = document.getElementById(“username”).value;
if (sResponseText == “available”)
{
alert(“The username “ + userValue + “ is available!”);
}
else
{
Search WWH ::




Custom Search