Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Form checkboxes and radio buttons
  • I've been experimenting with Fieldsets, Forms, Validations and there are a lot of nice features to make life easier. However, I'm having trouble with checkboxes and radio buttons. Specifically, in 2 areas: 1. When I try to repopulate a form after it fails validation (see code below), the radio buttons and checkboxes do not repopulate. All other inputs repopulate fine.
    $form = Fieldset::factory('form_news')->add_model('Model_News', $news_id)->repopulate();
    

    2. When printing out the form fields as shown below, the field label does not print out for checkboxes and radio buttons. All other labels print out fine.
    echo $form->form()->open();
    
    foreach ($form->field() as $index => $row)
    {
     echo $row;
    }
    
    echo $form->form()->close();
    

    Has anyone had success with checkboxes and radio buttons, and if so, was there anything special that needed to be done?

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!