Home Answers Viewqa JavaScriptQuestions Form validation Using Jquery Plugin

 
 


samar
Form validation Using Jquery Plugin
1 Answer(s)      2 years and 5 months ago
Posted in : JavaScript Questions

Hello sir

I want to implement form validation using JQuery Plug-in. My code is :

<html>
<style type="text/css">
    * { font-family: Verdana; font-size: 11px; line-height: 14px; }
    .submit { margin-left: 125px; margin-top: 10px;}
    .label { display: block; float: left; width: 120px; text-align: right; margin-right: 5px; }
    .form-row { padding: 10px 0; clear: both; width: 800px; }
    label.error { width: 250px; display: block; float: left; padding-left: 10px; }
    input[type=text], textarea { width: 250px; float: left; }
    textarea { height: 50px; }
  </style>
</head>
<body>

<body>
<h3><font color="blue">Please enter the following information</font></h3>

  <form method="post" action="">
      <div class="form-row"><span class="label">Name *</span><input type="text" name="name" id="namei"/></div>
      <div class="form-row"><span class="label">E-Mail *</span><input type="text" name="email" id="emaili"/></div>

      <div class="form-row"><span class="label">URL</span><input type="text" name="url" id="urli" /></div>
      <div class="form-row"><span class="label">Age</span><input type="text" name="quantity" id="quantity" /></div>

      <div class="label.error" id="errmsg"></div>
      <div class="form-row"><span class="label">Your comment *</span><textarea name="comment" id="commenti"></textarea></div>
      <div class="form-row"><input class="submit" type="submit" value="Submit" name="submit" id="submiti"></div>
    </form>
</body>
</html>

Please provide me JQuery code regarding above code ASAP.

View Answers

December 15, 2010 at 12:41 PM


First you need to download jquery.validate.js plugin. Here is the code according to your description :

<script type="text/javascript" src="jquery.validate.js"></script> <script type="text/javascript">

$(document).ready(function(){
       //called when key is pressed in textbox  $("#quantity").keypress(function (e)    {   $("#errmsg").hide();      //if the letter is not digit then display error and don't type anything     if( e.which!=8 && e.which!=0 && (e.which<48 || e.which>57))     {         //display error message         $("#errmsg").html("&nbsp;&nbsp;Digits Only").show(); 
       return false;
      }       });     $('#quantity').blur(function(a) {       if((parseInt($("#quantity").val(), 10)<18))     {
      $("#errmsg").html("&nbsp;&nbsp;Age must be greater than 18").show(); 
          }       if((parseInt($("#quantity").val(), 10)>35))     {
      $("#errmsg").html("&nbsp;&nbsp;Age must be less than 35").show();       }      });
    //FOR EMAIL ADDRESS     $("#form").validate({
        rules: {
          name: "required",// simple rule, converted to {required:true}
          email: {// compound rule
          required: true,
          email: true
        },
        url: {
          url: true
        },
        comment: {
          required: true
        }
        },
        messages: {
          comment: "Please enter a comment."
        }
      });    });   </script>









Related Pages:
Form validation Using Jquery Plugin
Form validation Using Jquery Plugin  Hello sir I want to implement form validation using JQuery Plug-in. My code is : <html> <style type...; } .form-row { padding: 10px 0; clear: both; width: 800px; } label.error { width
jQuery plugin examples code
:  Form validation using jQuery plug in & JSP The '... plugin Auto complete text box using jQuery plug in Pop... jQuery plugin examples code     
HTML form validation using jquery
HTML form validation using jquery  Is there any way for validating html elements common under a class by giving its class name in jquery validation code..that means validating all elements by using its class name if those
Html form validation using jquery
Html form validation using jquery  Hi i am using form with html. Form elements like textbox, radio,checkbox,listbox i was used now how to validate the elements using submit jquery option
Jquery form validation does not work
Jquery form validation does not work  I want to use jquery validation...;Have a look at the following link: JQuery Form Validation The above link provide you a good example of validating a form using jquery with illustration
Jquery form validation does not work
Jquery form validation does not work  I want to use jquery validation...;Have a look at the following link: JQuery Form Validation The above link provide you a good example of validating a form using jquery with illustration
jQuery email validation
jQuery email validation  Hi, I am using jQuery in my PHP based web application. I have to validate the email address entered by user on the form. I... is not correct. Give me good example code for validing email address in jQuery. Thanks
Form validation using jQuery plug in & JSP
Form validation using jQuery plug in & JSP In this tutorial, we will discuss about form validation using jQuery plug in & display of submit content using JSP. In the given below example a form is given ,whose fields  like
Ajax form validation Example
to validate form in Ajax using jQuery framework. Thanks...Ajax form validation Example  Hi, I want to validate my ajax form. Please give me good code for Ajax form validation. Thanks   Hi, Read
Difference between jQuery UI widget and plugin
. In the other hand, a widget usually is the representation of a plugin in the form...Difference between jQuery UI widget and plugin  JQuery UI widgets and plugin are included in the same way in html page. They work like the same way
form validation
form validation  how the form validation is done in jsf form using javaScript
Difference between jQuery UI widget and plugin
Difference between jQuery UI widget and plugin  ... and plugin Widgets are part of the jQuery UI library, where plugins aren..., a widget usually is the representation of a plugin in the form
jQuery password validation
jQuery password Validation : jQuery "equalTo: "#password" "... the jQuery part , the jQuery required for  the checking the validation... on the submit button. online demo: jQuery required validation
jQuery email validation
jQuery Email Validation : jQuery "required email" is the method... demo: jQuery email validation... with jQuery "required email" : In this example there are the following
jQuery required validation
jQuery required Validation: jQuery "required" is the method...; online demo: jQuery required validation...;/option>. Getting Started with jQuery required : In this example
JQuery url validation
jQuery url Validation : jQuery "required url" is the method... the validation by clicking on the submit button. online demo: jQuery required... } } }); </script> Getting Started with jQuery "
jQuery Demos
change event with multiple select option Form validation using jQuery... with an element using 'bind' jQuery 'select' form... in different file Display current time using jQuery & JSP
JQuery as validation controller
JQuery as validation controller  I would love to use JQuery as validation controller but i don't know how i use.Could u help me?   Here is a link that will provide you an example of validating email using jquery
jquery
jquery  how to display the leaves taken or holidays of the year or half working days in a calendar in some colors to identify the days using jquery plugin
Introduction to jQuery plugin
Introduction to jQuery plugin       Introduction to jQuery plugin JQuery plugins... . For jQuery official site for plugin click here Example : Zoom
jquery start date end date validation
jquery start date end date validation  Using JQuery how can i validate the end date and start date? for example if the start date is grater than...").rules('add', { greaterThan: "#StartDate" }); or $("form").validate
Please Provide jquery inline form validation
Please Provide jquery inline form validation  <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd...;/head> <body> <form action="LabAccountServlet" method="post"><
Please provide jquery inline form validation for the code
Please provide jquery inline form validation for the code   <...="white"> <form action="Student1Servlet" method="post" enctype="multipart/form... the following link: http://www.roseindia.net/tutorial/jquery
jQuery - jQuery Tutorials and examples
created many examples of using jQuery. View the demo's here. Learn jQuery step by step using the following tutorials: Overview of jQuery..., getting, and setting content using jQuery Manipulating attributes
jQuery Tutorials, jQuery Tutorial
, installing and developing first jQuery application Using different features... different types of selectors in jQuery Many reusable code examples Form... application using jQuery and JavaScript Don't wait start learning jQuery
How to reset a form in jQuery?
How to reset a form in jQuery?  Hi, I have a form where I am using jQuery. I want to reset the form. How I can reset the form grammatically?   Hi, You can use following code: $("#MyFomrName").reset(); Thanks
validation
form using spring ,hibernate and jsp my all classes and jsp pages are pasted here when i try to validate my form its says invalid property'validater of ur...="ISO-8859-1"%> <%@ taglib uri="http://www.springframework.org/tags/form
Validation
). How do i perform a check using JAVA on the data before storing... javax.swing.*; import java.awt.event.*; class Form extends JFrame { JButton ADD; JPanel panel; JLabel label1,label2; final JTextField text1,text2;; Form
spring form validation
spring form validation  how can we validate a web form using spring, try to give an example of the form containing some fields and their validations,ASAP......   Please visit the following link: Spring form validation
Custom Form Validation - PHP
Custom Form Validation  Which is the best way or where should I implement the custom validation rules such as ? using number, capital letters and symbols to secure the password
HTML Form Validation example
HTML Form Validation example  Can anyone guide me how to validate the user name and password field in HTML using simple or JavaScript Validation. Thanks in advance!   <form method="post" onsubmit="return
jQuery Training
and adding jQuery into your project Using jQuery for Ajax request a) jQuery post form b) jQuery get example c) Processing server response... jQuery UI widget and plugin jQuery based login and registration example
javascript form validation
javascript form validation  How to validate radio button , dropdown list and list box using onsubmit event..please give me a sample example..If we do...; } return true; } </SCRIPT> </HEAD> <form name="f1" onsubmit
login form validation - JSP-Servlet
login form validation  hi, how to validate the login form that contains user name and password using post method . the validation should not allow user to login in the address bar thanks regards, anand
PHP and JQuery
PHP and JQuery  How to make validation using PHP and JQuery
is it possible to add a button inside an autocomplete jquery ui plugin?
is it possible to add a button inside an autocomplete jquery ui plugin?  is it possible to add a button inside an autocomplete jquery ui plugin? My... a button that will open a jquery modal form, that the user can enter the desired data
jQuery Training Course
jQuery to submit the form using GET or POST method. There many plugins... to get content asynchronously Using jQuery to submit form Using jQuery... plugins Examples of jQuery form plugin How to create real-life application
Form Validation
Form Validation  Java script validation for checking special characters and white spaces and give an alert.Please help me urgent Thanks in advance
jquery color picker plugin
Color picker jQuery plug-in In this section, you will learn how to implement color picker in your web page using jQuery plug-in. In the given below example... the skin of color picker using 'css' file. Third ,by attaching to an text
How can we implement Pop-up in JQuery without Plugin?
How can we implement Pop-up in JQuery without Plugin?  Hi Sir How can we Implement pop-up in JQuery without using plug-in. Please provide me code... one png image for pop box. Here we are using "bubble.png" as background image
form validation
form validation  <form name="form" method="post" action="process.php" onsubmit="return validate(); "> <table align="center" border="1px... want validation code,username minimum 8 char,password length must >6,and one
Form validation
Form validation  Hi Everyone Can someone assist me with a complete code to validate a form. e.g where the user must insert an ID number it should check if the user entered the correct data and within a valid range. This must
How to save form data to a csv file using jquery or ajax
How to save form data to a csv file using jquery or ajax  Please let...=data.responseText; Now the problem is ,i should write form data to a csv file using ajax..., Thank you for your reply , i am suppose to use only jquery or ajax for doing
Downloading and installing jQuery Transform plug-in
to save your web page (in which plugin will use). For using...; NOTE : Due to Copy right , redistributions of this plugin in binary form... Downloading and installing jQuery Transform plug
validation
validation  we are doing payroll system project in java.So pls provide the complete validation code for employee master form
Using the jQuery Transform plug-in(XSLT)
Language Transformations ). The jQuery Plugin we are using... Using the jQuery Transform plug-in(XSLT)       Using the jQuery Transform plug-in(XSLT
JavaScript Form Validation
JavaScript Form Validation  JavaScript Form Validation
JQuery
JQuery  how to create jquery auto-complete textbox ? in which data...://www.roseindia.net/tutorial/jquery/autoSuggestTextbox.html   thank you for fast reply. when i m using key-down than cursor is not going down.i m not able
validation of strings using java function
validation of strings using java function  hi all, i am uploading data from csv file to data base where i took student id as string of length 6 char of the form abc123 will you please give me a function to validate this field
Help needed for Form Validation please help!
Help needed for Form Validation please help!  I have created a page which has login as well as Signup fields. I validated the login part by using jsp... to the login submit button. <html><form name=f1 method=POST action

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.