Form processing

08/10/2009 02:05

 

<html>
<head>
<title>Form processing</title>
<script language="JavaScript">
function func1()
{ var cnt1,cnt2;
cnt1=0;
cnt2=0;
alert("welcome")
if(document.myform1.text1.value=="")
 {
alert("Username field cannot be blank")
cnt1=1
}
if(document.myform1.pass1.value=="")
 {
alert("Password field cannot be blank")
cnt2=1
}
if((cnt1=1) &&( cnt2=1))
  {
alert("WELCOME"+document.myform1.text1.value)
}
}
</script>
</head>
<body>
<h2 align="center">Basic form processing</h2><hr>
<form name="myform1">
User Name<br>
<input type="text" name="text1" size="15"><br>
Password<br>
<input type="password" name="pass1" size="15"><br>

<input type="button" name="but1" value="Click Here" onClick="func1()" ><br>
</form>
</body>
</html>

Back

Search site

Copyright © 2012 Dadaso Zanzane. All rights reserved.