Make a form using the get method, and title the page Get Method Form size is h2. The page background is "any light color" and the form is in a page centered table. You must validate the name and age before the data is sent.


Sample of a JavaScript Validate Function
// Beginning of Validate function

<!-- 
function validate(){
var x=document.getElementById("myform");
firstname=x.fname.value;
submitOK="True";

if (firstname.length<2) { 
	alert("Your name must be at least 2 letters");
	submitOK="False"; }

y=0; 
for (i=0; i<(firstname.length); i++) {
	if (firstname.substr(i,1)<" ") { 
	y=y+1;}}

 if (y>0) { 
	alert("Your name has "+y+" digits in place of "+y+" letters");
	submitOK="False"; }
 
variableAge=x.yourage.value;

if ( variableAge > "99" ) { 
	alert("Your age must be digits only between 10 and 99");
	submitOK="False"; }

if (variableAge < 10 || variableAge > 99) { 
	alert("Your age must be between 10 and 99");
	submitOK="False"; }
 
if (submitOK=="False") { 
	return false; }
}
 //end of validation
 -->

To call the function validate() 
you need a onSubmit="return validate();" 
within the attributes of the form Tag.

Also look at Java Script which is the thing that will make your page behave like it was done by a professional. See sample9.html to get am idea of what is required.

  1. The form is to ask for a persons first name (fname) and his age (yourage).
  2. Each of the form input tag must be named as indicated in bold above for the form to work.
  3. Your form will call http://lmlv.net/getresponse.php.
  4. Be sure to include the focus on an input box (see Assignment 7).
  5. You also are required to have a return link from assignment 9 to your index page.
  6. Link assignment 9 to your web site index page.
  7. Upload assignment 9 file.
  8. Check that your form works properly.