How to add Validation rule in jQuery validation Plugin 1. Load the validate plugins <script src="js/jquery.validate.js"></script> 2. Now call the jQuery validate method <script> $(document).ready(function(){ // Add your own custom method $("#old_password").rules('add',{remote:"check_password.php", messages: {remote: "Passwords do not match"}}); $("#confirm_password").rules('add',{equalTo: "#password", messages: {equalTo: "New password and confirm password do not match"}}); }); controller action $count=$this->Member->find('count',array( 'conditions'=>array('Member.password'=>md5($_GET['oldPass']), 'Member.id'=>$this->Session->read('Member.id')))); if($count>0) { echo 'true'; die; } else { echo 'false'; die; } // valid...
Coding Cheatsheets - Learn web development code and tutorials for Software developers which will helps you in project. Get help on JavaScript, PHP, XML, and more.