Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Fieldset Generation and date/time selection
  • I am using the Fieldset add_model method too generate my forms based on my models. For one of the forms I need to be able to have users select a date and time entry. I would like to use a php generated calendar to be able to do this although I'm open to suggestions. What is the best way to achieve this using the fieldset options or will I have to extend the fieldset class to achieve my requirements? I know the date-time field is available in html 5 but as this is only supported by Opera (I believe) at present, it's not an ideal solution.
  • Depends a bit on what you exactly want. I have apps that use: extra form fields for day, month, year with dropdowns. Upon form submit, the controller will merge the contents of the three into the date field (Y-M-D), which is then validated. The date field itself is hidden on the form so it is present in $_POST javascript calender popups. they use the same trick, but fill in the hidden date field client side. you could also add a custom validation rule that fetches the data from the individual fields, assembles the date from them, then validate it. validation rules can update the posted value by returning it.

Howdy, Stranger!

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

In this Discussion