Ad Code

Responsive Advertisement

Java Script Form Element

 

Java Script Form Element 

<html>

<head>


<SCRIPT LANGUAGE="Javascript">

function check()

    {

naam=document.f1.t1.value

age=document.f1.t2.value

pw1=document.f1.p1.value

pw2=document.f1.p2.value

if(document.f1.t1.value==" ")

 {

 document.write("please enter your name");

 }

else if(document.f1.t2.value==" ")

 {

  document.write("enter your age");

}

else if(document.f1.p1.value=="")

 {

  document.write("Plese enter your password");

 }

else if(document.f1.p2.value= ="")

 {

  document.write("Plese enter your retype password");

 }

else if(pw1!=pw2)

 {

  document.write("sorry !!! Password not match..............try again!!!");

 }

else

 {

  document.write("<body bgcolor=red>hello, " +naam+"....................");

 }

                if(age<18)

{

document.write("You are only"+age+"years old..............not mature"+name+".....sorry...");

document.write("you can not take your decision.............");

}

else

{

   document.write("Oh.........! you are now"+age+"yeares old.....! Good...");

   document.write( "now get your work.....");

}

}

</script>

</head>

<body bgcolor=green>

<form name=f1>

<br>

name<input type=text name=t1 size=20><br>

age<input type=text name=t2 size=3><br>

Password<input type=password  name=p1><br>

Retype password<input type=password  name=p2>

<input type=submit name=submit value="submit now" onClick="check()">

</body>

</html>


Post a Comment

0 Comments