liquid_feedback_frontend
diff app/main/registration/_action/register.lua @ 1684:b1cec2dcc035
Added support for other option in dropdown fields
| author | bsw |
|---|---|
| date | Mon Sep 20 12:32:40 2021 +0200 (2021-09-20) |
| parents | 4232b30dfb11 |
| children | d09c3a0d17e6 |
line diff
1.1 --- a/app/main/registration/_action/register.lua Mon Sep 20 09:39:26 2021 +0200 1.2 +++ b/app/main/registration/_action/register.lua Mon Sep 20 12:32:40 2021 +0200 1.3 @@ -140,6 +140,21 @@ 1.4 1.5 else 1.6 local value = param.get("verification_data_" .. field.name) 1.7 + if field.type == "dropdown" then 1.8 + local other_option_id 1.9 + for i_options, option in ipairs(field.options) do 1.10 + if not option.id then 1.11 + option.id = option.name 1.12 + end 1.13 + if option.other then 1.14 + other_option_id = option.id 1.15 + end 1.16 + end 1.17 + if other_option_id and other_option_id == value then 1.18 + value = param.get("verification_data_" .. field.name .. "_other") 1.19 + end 1.20 + end 1.21 + 1.22 local optional = false 1.23 if field.optional then 1.24 optional = true