Log in Page Discussion History Go to the site toolbox

Java Script

From BluWiki

wesley willis rock and roll mcdonalds illinois labradors seikosha printer drivers chex tv news you leverage your contact center whether customer rick james video clip pirates of the caribbean 2 trailers top live billiards deluxe 1.5 crack analog capture video amazing 3d aquarium serial kid hit in head with basketball video clip links movies.net best buy laptop sale

http://varzel.com/reltrocbasr.html[racacrolvi] [[1][racacrolvi]]

"racacrolvi":http://zelbocelt.com/zelolorolbas.html

Boggan waxaan ku qori doonaa sida loo isticmaalo Java script language

Form aan html ku qoray waxaad samaysaa copy and paste to notepad or open dreanweaver if have macromedia installed your pc <?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"

"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">

<head>


<meta http-equiv="Content-Language" content="en-au" />

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-

1" /> <meta name="author" content="Gaaleef" />

<meta name="description" content="Form for validation practice" />

<meta name="keywords" content="form, javascript, validation" />

<title>Delivery Form Done</title>

<script type="text/javascript" src="alivalidateform.js">


</script>

<link href="alivalifateform.css" rel="stylesheet" type="text/css" />

</head>

<body>

Delivery Information

Please complete the following details

At present deliveries are only available in Brisbane, Melbourne and Sydney metropolitan areas.

Note: This information won't actually go anywhere

<form id="form1" onsubmit="return submitform()" action=""> <col width="50%" align="right" /> <col width="50%" align="left" />
Title

<select size="1" id="ftitle">

<option value="" selected="selected">Choose a title</option>
<option value="Dr">Dr</option>
         <option value="Ms">Ms</option>
         <option value="Mrs">Mrs</option>
         <option value="Miss">Miss</option>
         <option value="Mr">Mr</option>
</select>
Given Name(s) <input type="text" id="fgivenname" size="24" />
Family Name <input type="text" id="ffamilyname" size="20" />
Unit/floor number <input type="text" id="funit" size="8" />
House or building number <input type="text" id="fhouse" size="8" />
Street Name <input type="text" id="fstreet" size="20" />
Suburb Name <input type="text" id="fsuburb" size="20" />
State <select size="1" name="fstate">
         <option value="" selected="selected">Choose a state</option>
         <option value="NSW">New South Wales</option>
         <option value="Qld">Queensland</option>
         <option value="Vic">Victoria</option>
</select>
Post Code <input type="text" name="fpostcode" size="10" />
AUSTRALIA

E-Mail Address

<input type="text" id="femail" />
       <input type="submit" value="Submit" name="B1" />
<input type="reset" value="Reset" name="B2" />

</form>

 

</body>

</html>

Imankana waxaan formkii ku validate garayeeyey java script


var theform;

function submitform()

 {
  theform=form1;  
   if (!checktitle()) return false;
   if (!checkgivenname()) return false;

if (!checkfamilyname()) return false;

if (!checkfunit()) return false;

if (!checkfhouse()) return false;

if (!checkfstreet()) return false;

if (!checksuburb()) return false;

if (!checkstate()) return false;

if (!checkpostcode()) return false;

if (!checkemail()) return false;

 }
 

//This function is used to check if the user has selected a title

function checktitle()

 {
 temp = theform.ftitle.selectedIndex;
 utitle = theform.ftitle[temp].value;
  if(!utitle) 
    {
     alert("please put in your title");
      return false;
     }
  return true;
  }

//This function is used to check if the user has filed in the given

name textfield

function checkgivenname() {

 ugivenname=theform.fgivenname.value;   //This creates a variable 

named ugiven name and stores what the user has entered in the

textfield whose id is fgivenname

  if(!ugivenname)  //This if statment checks to see if the 

fgivenname textfield is blank

  {
   alert("please put your given name");   //Gives user a message to enter their name 
   theform.fgivenname.focus();            //This puts the cursor in the textfiled called fgivenname  
   return false;							// return false to the submit form function
  }
 return true;								// return true to the submit form function

}


function checkfamilyname() {

 ufamilyname=theform.ffamilyname.value;
  if(!ufamilyname)  
  {
   alert("please put your family name");
   theform.ffamilyname.focus();
   return false;
  }
 return true;

}


function checkfunit() { funitname=theform.funit.value; if(!funitname) { alert("please put your unit number"); theform.funit.focus(); return false; } return true;

 }


function checkfhouse()

{

fhousename=theform.fhouse.value; if(!fhousename) { alert("please put your house number") theform.fhouse.focus(); return false; } return true;

}
function checkfstreet()
{

fstreetname=theform.fstreet.value; if(!fstreetname) {

     alert("please put your street name")

theform.fstreet.focus(); return false; } return true; }

function checksuburb() { fsuburbname=theform.fsuburb.value;

if (!fsuburbname) { alert("please put your surburb name");

     theform.fsuburb.focus();

return false } return true

 }

function checkstate() {

 temp = theform.fstate.selectedIndex;
 ustate = theform.fstate[temp].value;
 if(!ustate) 
  {
   alert("please select  your state");
   return false;
  }
return true;

}

function checkpostcode() {

upostcode=theform.fpostcode.value;
if(!upostcode)  
   {
    alert("please enter your post code");
    theform.fpostcode.focus();
    return false;
    }
 temp=parseInt(upostcode);
//alert(temp);
if(isNaN(temp))
  {
   alert("put your postcode in numbers");
   theform.fpostcode.value="";
   theform.fpostcode.focus();
   return false;
   }
temp=temp.toString();
if (temp.length !=4)
   {
    alert("please put 4 numbers");
    theform.fpostcode.value="";
    theform.fpostcode.focus();
     return false;
    }
return true;

}

function checkemail() { femailname=theform.femail.value; if(!femailname) { alert("please put your email address") theform.femail.focus(); return false; } atPos = femail.indexOf("@",1) if(atPos ==-1) { return false; } if(femail.indexOf("@",atPos+1)>-1) { alert("Please enter a correct email address"); theform.femail.focus(); return false; } periodPos = femail.indexOf(".",atPos) if(periodPos ==-1) { alert("Please enter a correct email address"); theform.femail.focus(); return false; }

return true;

}


Back to main page

Site Toolbox:

Personal tools
GNU Free Documentation License 1.2
This page was last modified on 5 August 2009, at 12:59.
Disclaimers - About BluWiki