Usually cakephp doesn't validate the radio buttons, to re-produce that,
Step1:
In View:
<?php echo $form->radio('myfield',array(OPTIONS));?>
Step2:
After, <?php if(!empty($this->data)){
if(empty($this->data[MODEL]['myfield'])){$this->set('radioerror','ERROR MSG');}
NOW ALTER VIEW:
<?php echo $form->radio('myfield',array(OPTIONS));?>
<div class="error-message">
<?php if (isset($radioerror)){echo $radioerror;}?>
</div>
THAT'S IT.
Step1:
In View:
<?php echo $form->radio('myfield',array(OPTIONS));?>
Step2:
After, <?php if(!empty($this->data)){
if(empty($this->data[MODEL]['myfield'])){$this->set('radioerror','ERROR MSG');}
NOW ALTER VIEW:
<?php echo $form->radio('myfield',array(OPTIONS));?>
<div class="error-message">
<?php if (isset($radioerror)){echo $radioerror;}?>
</div>
THAT'S IT.
creepy *-*
ReplyDelete