The several value are setting each time the value for the radio.
So when the first one is created, value = 'always' and it is checked.
When Cake parses the second input and creates it, it sets the value to
'exact', and the second one is checked.
So I was finding always the last one selected, because it was the last
one to be created and "checked".
Cheers,
Gian.
On 26 Mar, 20:00, Gianluca <gc1...@googlemail.com> wrote:
> 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:
Post a Comment