Friday, March 26, 2010

input radio always checked?

Hello everybody,

In the app I am building I have these three radios:

echo $form->input('RuleRecurrence.weekdayconditions', array(
'type' => 'radio',
'options' => array('always' => 'Sempre'),
'checked' => ($WeekdayCondition == 'always' ? true : false),
'value' => 'always')
);

echo $form->input('RuleRecurrence.weekdayconditions', array(
'type' => 'radio',
'options' => array('exact' => 'Giorno preciso'),
'checked' => ($WeekdayCondition == 'exact' ? true : false),
'value' => 'exact')
);

echo $form->input('RuleRecurrence.weekdayconditions', array(
'type' => 'radio',
'options' => array('interval' => 'Intervallo'),
'checked' => ($WeekdayCondition == 'interval' ? true : false),
'value' => 'interval')
);

They are not consecutive and they are separated by some HTML code.
$WeekdayCondition is set to 'always'.

Do you have any idea why I get three inputs type=radio with the
"checked" attribute set to "checked" (for all of them!)?
(just the first one should be checked...)

Cheers,
Gian.


Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

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 For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

To unsubscribe from this group, send email to cake-php+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.

No comments: