Confused about CHtml::activeRadioButtonList

Hi,

i'm a little bit confused right now.

I've used activeRadioButtonList before and everything was fine, but now it doesn't work anymore with my form.

The problem is that there is a hidden input field automatically generated (in CHtml::activeRadioButtonList()) having the same name as my radio buttons.

Sending the form (with Firefox 3.0.10) results in 2 POST-Variables having the same name. The first is the hidden field which always has an empty value and the second one is the value of the selected radio button.

The result when reading from this variable in my controller is always an empty value…

Am i just over-worked or what's going on there??

Thanks

Could you show me the content in $_POST about the radiobutton list? The hidden field is there so that if nothing is selected in the radiobutton list, we can still get something.

Hi,

after having some sleep everything looks different  :D

Of course the hidden input field makes sense to get an empty variable if no radio button was selected. An of course is overwritten with the value from the selected radiobox because of the same name.

My problem was that the foreign key i was trying to assign hasn't got a rule-entry and therefore doesn't belong to the safe attributes and could not be assigned massively.

I'm still wondering why there isn't any rule because i generated the model using the model command and it should have the rule numerical… but i don't care right now.

Thanks anyway, qiang!