Solved

asp.net web form, and jquery validation

Posted on 2013-11-22
6
339 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
Comment Utility
you mean you don't want the defaut and small tooltip box?
0
 
LVL 82

Accepted Solution

by:
leakim971 earned 500 total points
Comment Utility
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
Comment Utility
0
 
LVL 82

Expert Comment

by:leakim971
Comment Utility
what about closing this question ?
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

In this article you'll learn how to use Ajax calls within your CodeIgniter application. To explain this, I'll illustrate how to implement a simple contact form to allow visitors to send you an email through your web site.
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery including how to code hide show and toggles. 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…

744 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now