1

I am using jQuery in my cakephp forms. I want to add validation using the way I have added my plugin. Putting required on selected input element automatic validates it. No matter if I add my plugin or not. I have included js helper..

public $helpers = array('Html', 'Form', 'Js'=>'jQuery', 'Text');

Like this. I want to stop the traditional way it follows for auto validation. And put the validation according to my requirement. I know cakephp 1.x version it follows the same way I want. but changes have been made in cakephp 2.x version for it autovalidation ? how can I stop that ?

2
  • Do I understand correctly; you want to perform validation with JavaScript only? Commented Apr 20, 2013 at 8:31
  • I want to perform the validation using jQuery plugin. Commented Apr 20, 2013 at 9:22

1 Answer 1

1

HTML5 form validation

Depending on the browser you're using, the validation-messages you see are probably part of the HTML5 validation performed by the browser. Recent versions of Chrome will automatically perform Form Validation for input elements that have a required attribute.

You can disable HTML5 validation by adding a novalidate attribute to the <form> tag.

See this question for more information:

Disable validation of HTML5 form elements

Note

Although validating with jQuery can be a nice addition (from a user-interface perspective), you should never rely on validation in the browser alone. Always be sure to perform proper server-side validation. In CakePHP this is done in the models, see Data Validation

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.