hidden fields in forms module

edited April 2016 in Modules
hidden fields not adding to database on submit any ideas

Comments

  • edited 6:11AM
    Need more information.
  • edited 6:11AM
    added hidden fields in form module but when form is submitted the values of the hidden fields do not appear in the database
  • edited 6:11AM
    Hidden fields are cleaned out of the data that is to be saved. An alternative would be to just visually hide an input field.
  • edited 6:11AM
    Any way I can override that behaviour without modifying the module
  • edited April 2016
    You would have to extend the Fuel_forms class and overwrite the clean_posted method and then somewhere in your code you'll need to overwrite it by calling the attach method on FUEL:
    $form= new My_fuel_form(); $this->fuel->attach('form', $form);
  • edited 6:11AM
    OK thank you will take a look at doing that
  • edited 6:11AM
    tried the above but it never calls my cleaned_post function in the extended MY_fuel_form is there something else im missing
  • edited 6:11AM
    Is the attach happening before you are calling the cleaned_post function?
  • edited 6:11AM
    Yes looking at extending the forms class as well but not having much sucess
  • edited 6:11AM
    Try adding your class to the fuel/application/libraries/My_fuel_form. Then in your fuel/application/config/MY_fuel.php there is a $config['attach'] parameter you can use to attach it:
    $config['attach'] = array( 'forms' => 'my_fuel_form' );
  • edited 6:11AM
    thank you ive now gone down a different root. I would like to ask if it may be possible to do a multistep form in the forms module any suggestions would be grateful before i start pulling things apart :)
  • edited 6:11AM
    The forms module does not support automatically creating a multi step form unfortunately.
Sign In or Register to comment.