hidden fields in forms module

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

Comments

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