I have the following code added in my default.ctp
echo $this->Html->script('jquery.validate.min');
echo $this->Html->script('additional-methods.js');
echo $this->Html->script('jquery.metadata');
UsersController.php has the Helper set up
public $helpers = array('Html', 'Session','Form', 'Js' => array('Jquery'), 'JqueryValidation');
add.ctp has the validation implemented:
<?php echo $this->Form->create('User', array('class' => 'jquery-validation')); ?>
<fieldset>
<legend>
</legend>
<?php
//echo $this->Form->input('username');
echo $this->JqueryValidation->input('username');
echo $this->JqueryValidation->input('first_name');
echo $this->JqueryValidation->input('last_name');
echo $this->JqueryValidation->input('password');
echo $this->Form->input('role', array(
'options' => array('admin' => 'Admin', 'author' => 'Author')
));
Does the jquery validation helper (http://bakery.cakephp.org/articles/matt_1/2012/10/11/jquery_validation_helper) work with cakephp 2.2.4?
Thanks.
--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
No comments:
Post a Comment