Quantcast
Channel: W3easystep » MySQL tutotial
Viewing all articles
Browse latest Browse all 4

jQuery form validation plugin 1.0

$
0
0

jQuery Form validation Plugin 1.0, It is called as

validateForm

Validating form is very important while we are taking the input from user, And validating form using validateForm plugin is very easy.
I came to know that some people are struggling with form validation and displaying the error messages.

Using this plugin, you don”t need to worry about that, after installing the plugin successfully, It does everything.

You can validate almost all the input types, text-areas, select boxes etc.

“It prevent the default form submission as long as errors appear”

  1. Validating the form
  2. displaying the errors

 

Installing the plugin doesn’t take more than one(1) minute

See the instructions below:

  • Including jQuery library and validate form plugin
    • Add the following the lines of code in the header section of you document.
    • You get these files in the downloaded folder
<script src="library.js" type="text/javascript"></script>
<script src="jquery.validateform.js" type="text/javascript"></script>
  • Installing the plugin
    • Add the the following after including plugin file.
    • “register is the id of the form
<script>
$(document).ready(function(){
  $("#register").validateForm();
});
</script>
  • Writing styles to error(optional)
    • You can make error display to be more effective by applying styles with class name “error

See the demo and Download the files from the following links

Demo

Here you can pass your own regular expressions to validate.

Ex:

<script>
$(document).ready(function(){
$("#register").validateForm({
emailReg: /^([\w-\.] @([\w-] \.) [\w-]{2,4})?$/,
});
});
</script>

 

Similarly you can pass “urlReg”

 

The post jQuery form validation plugin 1.0 appeared first on W3easystep.


Viewing all articles
Browse latest Browse all 4

Trending Articles