views:

133

answers:

2
<form id="myForm" runat="server">
username
<asp:TextBox ID="txtuser" runat="server">
</asp:TextBox>
Password
<asp:TextBox ID="txtpass" TextMode="Password" runat="server">
</asp:TextBox>
<asp:Button ID="btnsubmit" Text="submit" runat="server" OnClientClick="Val()" />
</form>

this is my source code anyone validate it or if anyone have any ebook for mvc & web deveopment so post it

+6  A: 
  1. load jQuery
  2. load the jQuery Validate plugin
  3. read through the docs for it: http://docs.jquery.com/Plugins/Validation. There are lots of examples with source code.

If you have a specific question about how to do something with jQuery or the plugin, I suggest you ask a new question that's not so broad.

Gabriel Hurley
+1 Good stab at another exhaustingly vague question.
JoshJordan
hahaha, thanks!
Gabriel Hurley
A: 

I don't know ASP well enough but watch for generated IDs these may not necessarily match what you have in <asp:TextBox/> The best way to verify is to look at the generated markup. Once you know how IDs are generated you simply put your validation into onblur event of the filed in question and/or tight it to form "submit". And as was pointed out you can use jQuery validate plugin to take advantage of some pre-built validation routines

DroidIn.net