CakePHP Radio Fieldsets

Feb 28, 03:01 PM

Josh needed to output a cakePHP radio button set without the radio button’s around it. We looked at the API, the docs, etc. We just could not figure it out ( 'fieldset'=>false ? or maybe 'fieldset'=>null ?). Nope.

So Josh went off looking and found out you just set 'legend'=>false in the input option’s array:

echo $form->input('user_need', array('option'=>$radios, 'legend'=>false));

…yes, a user can only have one need at a time….muwahaha

Also, you can also select which radio button is “active” on page load using “value”=>[the value].

Walker Hamilton

,

Comment

  1. “checked” doesn’t work!!!

    W0O0W · Apr 14, 06:33 AM · #

  2. My bad. Fixed the entry.

    Walker Hamilton · May 29, 06:02 AM · #

 
---