jQuery Validation With Masterpage in asp.net

qnd_nz

New Member
i have a childpage.aspx in masterpage and i am trying to validate required field in childpage through masterpage, the following code i have write in masterpage to validate\[code\]$(document).ready(function() { var container = $('#sam586'); $("#aspnetForm").validate( { errorContainer: container, //errorClass: "invalid", errorLabelContainer: $("#sam586"), wrapper: 'li', meta: "validate", rules: { ctl00_ContentPlaceHolder1_txtUserName: { required:true }, ctl00_ContentPlaceHolder1_txtPassword: { required:true }, ctl00_ContentPlaceHolder1_txtFirstName: { required:true }, ctl00_ContentPlaceHolder1_txtLastName: { required:true }, ctl00_ContentPlaceHolder1_ddlDepartment: { required:true }, ctl00_ContentPlaceHolder1_ddlDesignation: { required:true }, ctl00_ContentPlaceHolder1_txtEmail: { required:true, email:true }, ctl00_ContentPlaceHolder1_ddlStatus: { required:true }, ctl00_ContentPlaceHolder1_ddlRole: { required:true } }, messages: { ctl00_ContentPlaceHolder1_txtUserName:"Please enter username", ctl00_ContentPlaceHolder1_txtPassword:"Please enter password", ctl00_ContentPlaceHolder1_txtFirstName:"please enter first name", ctl00_ContentPlaceHolder1_txtLastName:"Please enter last name", ctl00_ContentPlaceHolder1_ddlDepartment:"Select Department", ctl00_ContentPlaceHolder1_ddlDesignation:"Select Designation", ctl00_ContentPlaceHolder1_txtEmail:"Enter proper email address", ctl00_ContentPlaceHolder1_ddlStatus:"Select Status", ctl00_ContentPlaceHolder1_ddlRole:"Select Role" } }); });\[/code\]when is try all this stuff in single aspx page it work perfectly.but the problem is i want to show validation erro in div tag name:("sam586") which later will be converted into the greypopup with the help of jquery .so any one can helpme out ,or any suggestion is appreciable.thanks in advance.
 
Back
Top