How to fill in fields when an option is selected in a dropdown list ?
Hello !
Is there an easy way (Fuel CMS often has some ) to fill in other fields with values when :
- an option is selected in a dropdown list
- a field is changed (like a date field)
Something like javascript "onblur"
Comments
There is a "linked" field type that sounds maybe close to what you want:
https://docs.getfuelcms.com/general/forms#linked
Thanks, I looked at it, but it seemed to only fill another dropdown list, did I misunderstand something ?
It should act similar to a slug field in that the values from one field will be used to fill out another field (with a specified function applied to it like "mirror", "strtotupper", "strtolower", "slug).
What I would like to do :
I am almost sure I will have to do ajax calls, but I am not sure how to do this in the Fuel CMS framework.
I would take a look at creating a custom field in which you can import and associate your own Javascript:
https://docs.getfuelcms.com/general/forms#association_parameters
hello, do you have any example to point me in the right direction ? I searched all the existing modules for something similar, but have not found.
The core
fuel
andforms
module has some examples. You can add your own in thefuel/application/config/custom_fields.php
file:https://github.com/daylightstudio/FUEL-CMS/blob/master/fuel/modules/fuel/config/custom_fields.php
https://docs.getfuelcms.com/modules/forms
https://github.com/daylightstudio/FUEL-CMS-Forms-Module/blob/master/config/custom_fields.php
Thanks, I will look into that !