Write this javascript code inside "HEAD" - "SCRIPT" tag
function chkPass()
{
if(form1.TextBox1.value.length < 5)
{
alert("Password must be of more than 5 and less char");
return (false);
}
else if(form1.TextBox1.value != form1.TextBox2.value)
{
alert("Both Password are not the same");
return (false);
}
}
call this function in form's onsubmit event
form id="form1" runat="server" onsubmit="return chkPass()"
Get C#, ASP.NET, HTML, JavaScript, XML, WCF, Web services and Ajax tips.
menu
- Home
- Asp.Net
- MVC
-
C#
- Ref
- Constructor
- Constructor Program
- Jagged Array
- Command Line Argument
- Stack and Heap
- Ref and Out
- Const, ReadOnly and Static
- Generic
- Two Interfaces With Same Method Name
- Inheritance
- Is Keyword
- Custom List with OnAdd Event
- Data Annotation
- Covariance & Contravariance
- Signing - Strong vs Weak Reference
- Sorting List by IComparable vs IComparer
- WCF
- JavaScript
- SQL
- Others
- Contact
No comments:
Post a Comment