Solved

asp.net web form, and jquery validation

Posted on 2013-11-22
6
365 Views
Last Modified: 2013-12-27
With below code. how to add jquery validation code?
just simple if textbox is empty then show message <label>Required</label> next to the textbox.
 
 <form id="masterForm" runat="server">

 <input class="span3" runat="server" id="email" name="email" placeholder="Email" type="text" />                                                  
                                                   <input class="span3" runat="server" placeholder="Password" id="password" name="password" type="password" />


 

</form>    


 <script src="http://ajax.microsoft.com/ajax/jquery/jquery-1.4.2.js" type="text/javascript"></script>
       
 <script src="http://ajax.microsoft.com/ajax/jquery.validate/1.7/jquery.validate.js" type="text/javascript"></script>
0
Comment
Question by:solution1368
  • 3
6 Comments
 
LVL 82

Expert Comment

by:leakim971
ID: 39670808
you mean you don't want the defaut and small tooltip box?
0
 
LVL 82

Accepted Solution

by:
leakim971 earned 500 total points
ID: 39670816
Test page : http://jsfiddle.net/6uDPn/

    $("#masterForm").validate({
           rules :{
               email: { required: true, email: true  },
               password: { required:true }
           }
    });

Open in new window

0
 

Author Comment

by:solution1368
ID: 39670916
0
 
LVL 82

Expert Comment

by:leakim971
ID: 39671229
what about closing this question ?
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Add a Condition in ASP Repeater 6 34
Asp in server side with Mssql Server 7 4 27
Insert Button on a table 16 38
ajax wont trigger twice without a page refresh 7 14
Introduction A frequently asked question goes something like this:  "I am running a long process in the background and I want to alert my client when the process finishes.  How can I send a message to the browser?"  Unfortunately, the short answer …
Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question