Saturday, 22 September 2012

JQuery validation with Regular expressions

// siddhu vydyabhushana // 1 comment
jQuery is a javascript library used to develop web applications.!
it will help u to develop good user interface.....in engineering 
Regular Expressions will poke u..

after enter ur input into text it will automatically pops up....

Before going to develop u need to use jquery.validator.js

DOWNLOADhttps://www.box.com/s/iu027r2qbiqr8mid088m

jQuery code:



<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.0/jquery.min.js" type="text/javascript"></script>
<script src="jquery.validate.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
$.validator.addMethod("email", function(value, element) {
return this.optional(element) || /^[a-zA-Z0-9._-]+@[a-zA-Z0-9-]+\.[a-zA-Z.]{2,5}$/i.test(value);
}, "Please enter a valid email address.");
$("#signup").validate({

rules: {

email: "required email",
},

});
});



</script>

HTML CODE:


<style>
body
{
font-family:Arial, Helvetica, sans-serif;
font-size:13px;
}

label.error
{

background-color:#9900cc;
color:#FFFFFF;
padding:3px;
}
</style>

</head>
<body>
<div align="center">

<form method="post" action="jqueryregthank.html" name="signup" id="signup">
<b>ENTER UR EMAIL:</b><br />
<input type="text" name="email" id='email'><br />
<input type="submit" value=" Sign-UP " name='SUBMIT' id="SUBMIT"/>

1 comment:

  1. in this site SMS Marketing software is easy to use & powerful Programe allows you to send marketing ,,visit site

    ReplyDelete