TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
RAGHUNATH
1.7k
63
49.9k
how to validate a form using jquery? help me where i mistake
Mar 26 2014 3:48 PM
I need to validate a register form using Jquery. and i tried using jquery validate method but i am not getting output.
------------------------------------------------------------------------
can any body help where i am wrong?
-----------------------------------
I am attaching what i have done.. plz help me..
-----------------------------------------------
<script src="../../Scripts/jquery-1.9.0.min.js" type="text/javascript ">
</script>
<script src="../../Scripts/jquery.validate.js" type="text/javascript"></script>
<script src="../../Scripts/jquery.validate.min.js" type="text/javascript">
</script>
<script type="text/javascript">
$(document).ready(function () {
$("#form1").validate({
rules: {
txtfirstname: "required", // simple rule, converted to {required:true}
txtlastname: "required",
txtusername: "required",
txtpassword: "required",
txtemail: {// compound rule
required: true,
email: true
},
txtaddress: "required",
txtstate: "required",
txtcity: "required",
txtzip: "required"
},
messages: {
txtzip: "Please enter a comment."
}
});
});
</script>
<form action="" method="post" id="form1">
<div>
<table>
<tr>
<td>
<label>
Firstname</label>
</td>
<td>
<input type="text" id="txtfirstname" name="txtfirstname" />
</td>
</tr>
<tr>
<td>
<label>
Lastname</label>
</td>
<td>
<input type="text" id="txtlastname" name="txtlastname" />
</td>
</tr>
<tr>
<td>
<label>
Username</label>
</td>
<td>
<input type="text" id="txtusername" name="txtusername" />
</td>
</tr>
<tr>
<td>
<label>
Password</label>
</td>
<td>
<input type="text" id="txtpassword" name="txtpassword" />
</td>
</tr>
<tr>
<td>
<label>
Email</label>
</td>
<td>
<input type="text" id="txtemail" name="txtemail" />
</td>
</tr>
<tr>
<td>
<label>
Address</label>
</td>
<td>
<input type="text" id="txtaddress" name="txtaddress" />
</td>
</tr>
<tr>
<td>
<label>
State</label>
</td>
<td>
<input type="text" id="txtstate" name="txtstate" />
</td>
</tr>
<tr>
<td>
<label>
City</label>
</td>
<td>
<input type="text" id="txtcity" name="txtcity" />
</td>
</tr>
<tr>
<td>
<label>
Zip</label>
</td>
<td>
<input type="text" id="txtzip" name="txtzip" />
</td>
</tr>
<tr>
<td>
<input type="button" id="btnclick" value="SUBMIT" />
</td>
</tr>
</table>
</div>
</form>
Reply
Answers (
3
)
Jquery Plugin Not Working
Hide the asp gridview lines using javascript or jquery