Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Small but complete fieldset example?
  • The docs for both forms and validations advertise that if you want to do both together, fieldset is the way to go, hence my being curious... I would love to see a small but complete Fieldset example.
    I'm fine if your example has only a label and a textfield, but would love to see validation leading to inline error reporting within the view, say turning label and textfield red if data is invalid. Mostly, I'm at a loss as far as how to affect the view at will when it only consists only of:
    echo $form;
    
    I've sort of accomplished the above using a combination of forms and validations. It's working, but seems kinda big & ugly with quite a few if statements in the view to pretty up the presentation and show errors.
    Screenshot of my form and validation example:
    http://dropdo.com/1hF/form_and_validation. Thanks in advance.
  • Have a look at Jschreuders' FuelDocGenerator app to get an idea of how it works.
  • I should have mentioned that I have done a bit of homework. I have seen FuelDocGenerator already, as it seems to be the only Fieldset example available anyway. I've also gotten some feedback through IRC, especially concerning validation + forms (thanks again to kelsoB, huglester and SirFunk for their help. I hope I didn't forget anyone) and a little bit on Fieldset as well. WanWizard, while I appreciate the prompt reply, unfortunately, the FuelDocGenerator fieldset example does not at all address the meat of what I'm seeking information about: inline error reporting within the view.
  • The Fieldset class is Jelmers baby, but he's tied up in ORM at the moment. I'm sure when he has the time he'll add some more examples to the docs.

Howdy, Stranger!

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

In this Discussion