Radio button error message not showing up

Showing 1-3 of 3 messages
Radio button error message not showing up aapljack 3/26/10 12:05 PM
I am building a form with a set of radio buttons and am failing to get
any kind of error message when they don't pass the validation.

Here is the model code I have for validation..

var $validate = array(
                'name' => array(
                        'rule' => 'notEmpty',
                                'message' => 'Name is required'
                ),
                'email' => array(
                        'rule' => 'email',
                        'message' => 'A valid email address is required'
                ),
                        'services' => array(
                                'rule' => 'notEmpty',
                                'allowEmpty' => false,
                                'message' => 'Select a service'
                        )
            );

The 'Services' are the radio buttons I am validating.

Here is the code for the view for the 'Services' radio buttons. These
were taken from an example and not changed. Trying to get them to work
first..

  $options = array('M'=>'Male','F'=>'Female');
  $attributes = array('legend'=>true);
  echo $form->radio('Contest.services',$options,$attributes);

The form seems to be validating the radio buttons, but it will not
give me an error message on the page.

Any ideas?

Thanks!

Brian

Re: Radio button error message not showing up Dr. Loboto 3/26/10 10:29 PM
Use $form->input() instead of $form->radio() or use $form->error()
together with $form->radio()
Re: Radio button error message not showing up Pradhap 6/14/12 1:54 AM

I hope this may work,

this worked for me

http://webnans.blogspot.com

Thanks

Pradhap