Note the upgraded forum! If you are experiencing issues logging in, you may need to reset your password which should send an email. If the email doesn't arrive, be sure to check your spam folder just in case.
Hi!
I'm using the "select2" type of field for several fields in my form.
Everything works as expected, but once a value is selected and saved i cannot "empty" or reset the value anymore.
I get an "Add" and a "Edit" buttons beside the dropdown, but I need a "reset" button too.
Those fields are not required.
Any help?
How can i do this?
Comments
I don't want to add a "no value" record to the table.
I used the "first_option" parameter, as suggested by admin, but i had to implement the "on_before_save" function to replace the "0" value to NULL. Otherwise, the "0" is saved.
$fields['lugar_nacimiento_provincia_id']['first_option'] = array(0=>' ');
Is there a better way to do that in order to avoid the on_before_save changes?
Thanks!!
$fields['lugar_nacimiento_provincia_id']['first_option'] = 'Select one...';
And no default value for that field in the db.
http://docs.getfuelcms.com/general/models#hooks
It's OK, it's not a big problem keeping the on_before_save hooks I implemented.
Thanks for your help!