KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I am trying to have a Checkbox "Agree TOS". If the Checkbox is not checked , I want to put out a Flash Message. How do I do this? My View: <?php echo $form->create('Item', array('url' => array_merge(array('action' => 'find'), $this->params['pass']))); echo $form->input('Search', array('div' => false)); echo $form->submit(__('Search', true), array('div' => false)); echo $form->checkbox('tos', array('label' => false, 'value'=>1)).' Agree TOS'; echo $form->error('tos'); echo $form->end(); ?> My Model: var $check = array( 'tos' => array( 'rule' => array('comparison', 'equal to', 1), 'required' => true, 'allowEmpty' => false, 'on' => 'index', 'message' => 'You have to agree TOS' ));
Tags (comma-separated)
Save Edits
Cancel