Competitive Study Materials
  • Home
  • Abbreviations
  • Solved Papers
  • Current Affairs
  • Contact Us
  • Home
  • Computer Knowledge
  • General Knowledge
  • Abbreviations
  • Solved Papers
  • Current Affairs

Validation of Username and Password using JavaScript

 Shakeel Ahamed     Web Design     No comments   

Follow us on Facebook

<html>
<head>

<script language="javascript" type="text/javascript">

function validateForm()
{
var result = true;
var msg="";
if (document.form.Username.value=="")
{
msg+="You must enter your Username \n";
document.form.Username.focus();
document.getElementById('Username').style.color="red";
result = false;
}
if (document.form.Password.value=="")
{
msg+="You must enter the Password \n";
document.form.Password.focus();
document.getElementById('Password').style.color="red";
result = false;
}
if (document.form.Email.value=="")
{
msg+="You must enter the Email \n";
document.form.Email.focus();
document.getElementById('Email').style.color="red";
result = false;
}                
if(msg=="")
{
return result;
}
{
alert(msg)
return result;
}
}
</script>
</head>
<body>
<h1>Account Setup Page</h1>

<form name="form" method="post" action="success.html">

<table width="50%" border="0">
<tr>
<td id="Username">Username</td>
<td><input type="text" name="Username" /></td>
</tr>

<tr>
<td id="Password">Password</td>
<td><input type="text" name="Password" /></td>
</tr>

<tr>
<td id="Email">Email</td>
<td><input type="text" name="Email" /></td>
</tr>

<tr>
<td><input type="submit" name="Submit" value="Submit" onClick="return validateForm();" /></td>
<td><input type="reset" name="Reset" value="Reset" /></td>
</tr>
</table>
</form>
</body>
</html>
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
Email ThisBlogThis!Share to XShare to Facebook
Newer Post Older Post Home

0 comments:

Post a Comment

Popular Posts

  • A to Z Computer Abbreviations
    ACE: Access Control Entry ADSL: Asymmetric Digital Subscriber Line AGP: Accelerated Graphics Port AI: Artificial Intelligence ALGOL: A...
  • भारत के राष्ट्रपति : ( सामान्य ज्ञान )
    01. भारत का संवैधानिक प्रधान कौन होता है ? ► राष्ट्रपति 02. भारत के प्रथम राष्ट्रपति कौन थे ? ► डॉ. राजेंद्र प्रसाद (लगातार दो बार राष...
  • भारतीय अर्थव्यवस्था : (सामान्य ज्ञान)
    ● महूबब-उल हक के सहयोगी कौन थे— ए. के. सेन तथा सिंगर हंस ● मानव विकास सूचकांक की अवधारणा का प्रतिपादन कब किया गया— 1990 ● मानव किकास सूचक...

All Category

  • Abbreviations List
  • Computer Category List
  • Computer Practice List
  • Computer Quizzes List
  • G.K Quizz List
  • General Knowledge
  • GK In Hindi
  • Solved Papers List
  • SSC Solved Papers List

All Labels

  • Banking Abbreviatons
  • Basic Computer GK
  • Computer Abbreviations
  • Computer Knowledge
  • Computer MCQs for IBPS
  • GK Quizz
  • General Knowledge
  • IBPS GK Solved Papers
  • IBPS Solved Papers
  • SSC Solved Papers
  • Web Design

Solved Papers

  • SSC SOLVED PAPERS
  • BANKING SOLVED PAPERS
  • COMPUTER SOLVED PAPERS
  • OTHER EXAMS SOLVED PAPERS

Search This Blog

Total Pageviews

Translate

Copyright © Competitive Study Materials | Developed By- Shakeel Ahamed