hidden fields in forms module

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

Comments

  • edited 8:05PM
    Need more information.
  • edited 8:05PM
    added hidden fields in form module but when form is submitted the values of the hidden fields do not appear in the database
  • edited 8:05PM
    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 8:05PM
    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 8:05PM
    OK thank you will take a look at doing that
  • edited 8:05PM
    tried the above but it never calls my cleaned_post function in the extended MY_fuel_form is there something else im missing
  • edited 8:05PM
    Is the attach happening before you are calling the cleaned_post function?
  • edited 8:05PM
    Yes looking at extending the forms class as well but not having much sucess
  • edited 8:05PM
    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 8:05PM
    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 8:05PM
    The forms module does not support automatically creating a multi step form unfortunately.
Sign In or Register to comment.