Solved

asp.net web form, and jquery validation

Posted on 2013-11-22
6
351 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Introduction Got endorsements from your clients?  Great!  There is almost nothing better than word-of-mouth advertising.  But how can you do that on the internet?  Sure you can make a page for endorsement quotations and list them all, but who is …
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.
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)

863 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

25 Experts available now in Live!

Get 1:1 Help Now