Hi there,
I am building a site that needs some custom Jquery validation. I am looking for optimal way to implement it in my project. I came across a article in ss bits that looks like it is perfect for my needs, but i cant get it to work in SS3. http://www.ssbits.com/tutorials/2009/using-jquery-for-form-validation/
Essentially you load in the jquery 'validate' plugin and then just add the following code to the init function in the page controller. But i cant get it to work. Any thoughts would be appreciated.
I have tried disabling validation by using ' Validator::set_javascript_validation_handler('none');' to do so, but i get the following error:
[User Deprecated] Validator::set_javascript_validation_handler is deprecated. Use custom javascript validation instead.
<b>The validation code looks like this: </b>
Requirements::customScript('
jQuery(document).ready(function() {
jQuery("#Form_CustomerForm").validate({
rules: {
Email: {
required: true,
email: true
},
Tel1: {
required: true,
minlength: 10,
maxlength: 10
}
},
messages: {
Email: "It is quite important that you give me your actual email address so I can send you messages",
Tel1: "The phone number is wrong"
}
});
});
');