Friday, January 2, 2009

Radio button value null after post, but appears in post headers upon inspection

I am rendering a series of radio buttons using $form->input.
Validation in the model specifies 'numeric' for the field. Even whena
radio button is selected, this displays after submit:'This field
cannot be left blank' (note: the message does not say 'must be
numeric', it says blank, suggesting no data).

When I remove the validation rule altogether, I get 'Warning (512):
SQL Error: 1048: Column 'underwear_type_id' cannot be null'

Viewing the post headers via Firebug I can confirm one of the radio
button did have a selected value. Here is a dump of $this->data after
submitting the form:

data[EdibleUndy][underwear_type_id]
data[EdibleUndy][underwear_type_id] 1
data[EdibleUndy][underwear_type_id]
data[EdibleUndy][underwear_type_id]
data[EdibleUndy][underwear_type_id]

I should note that when I view the rendered HTML source, there is a
hidden form field with the same name as the radio inputs containing no
value (value='').

Any suggestions or direction is appreciated.

Cheers!

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

No comments: