Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Best way for a stylish Form?
  • Hi there,

    for one of my projects I use a HTML Template.

    In this Template there are very nice forms. You can see them here:
    http://192.241.236.31/test4.smartadmin/#ajax/form-templates.html

    I would like to use the fieldset class with the add_model action to generate the whole form, as I only want to change the field properties in my model.

    Is it possible to use this way for such "complicated" html forms?
    If yes, does someone has an example how to do that?

    I know that I have to change the form.php om config area, but my actual problem is, how to change the single fields as this would be the HTML for one field:
    http://bin.fuelphp.com/snippet/view/De

    Hope, somene could give me some hints.

    Thanks
    Kay
  • You can always use fieldset, the question is what you can automate with it.

    With forms this complex, you probably have to create the structure manually (like it is done now, and replace the input fields with individual echo $fieldset->build('fieldname'); statements.

    And you'll have to either strip the form definition in the config file, or pass a custom form config to the fieldset, to avoid additional HTML being added by build(). You have to experiment a bit that you can leave in the template and what you have to remove.

    This works fine in our applications, you keep all fieldset functionality (like validation) in your controller.

Howdy, Stranger!

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

In this Discussion