You just need a simple HTML Form
Tag around the Select
Tag and then read the Form
Parameters inside your Perlscript with something like params->{'ldap_selected'}
. I can suggest to read the Dancer
Documentation.
For this case you can start to take a look here
EDIT:
After your edit, it seems to be a Template Toolkit
Problem. You said, that you have the Value of ldap_selected
and it seems to be the value you need. [% IF ldap == ldap_selected %]
is exactly the thing you need to do. Your Syntax is correct.
There are 2 Possible Problems/Solutions i can see there:
ldap_selected
contains a newline or its not set.ldap
contains a newline.
Check with ctrl+u inside your browser the output of each variable. Maybe you can see a newline. Try the IF ...
Part with an hardcoded ldap_selected
([% IF ldap_selected == 'foo' %]
) and with
[% FOREACH ldap IN [ 'foo', 'bar', 'baz' ] -%]
The ldap
Part.
When nothing works, check if you maybe changed the Configuration of TT
in your MyWeb-App/config.yml