Enables parameterized database queries
This form illustrates how you can retrieve the options for a select field from a datasource, and add a filter to the database query. That can happen either when form is initially loaded, or triggered when the user enters a value into a form field.
Currently, only selection lists can be filtered. Radiobutton and checkbox lists are not supported!
Important: This demo form requires an additional script to work correctly. You can download it via the following button. Then upload the script under Files & Templates > Files or directly at the form under Files.
Filtered federal states (all names which starts with "n" or contain "burg")
Display value
Name of the field is a combination of the corresponding selection and "DisplayValue". Only if the name fits, works the setting of the data!
Value
Name of the field is a combination of the corresponding selection and "Value". Only if the name fits, works the setting of the data!
Database query "states_data_two_placeholders":
SELECT name, id_state FROM state WHERE name LIKE CONCAT(?,'%') OR name LIKE ? ORDER BY name;
Federal state*
Cities filtered by previously selected federal state
Database query "city_data_by_state":
SELECT name, id_city FROM city WHERE id_state = ? ORDER BY name;
Federal state starts with...*
Filtered states (all names which begins with selected letter)
Database query "states_data_starts_with":
SELECT name, id_state FROM state WHERE name LIKE CONCAT(?,'%') ORDER BY name;