I'm attempting to pass two variables to a ad_proc and I want to use these variables in a widget selection box. How do I reference the variables in the select option list.
This is what I have:
in main tcl page:
-----------------
set allowed {gambling hate kids}
set restricted {chat email}
set select_widget [switch $allowed $restricted]]
in tcl ad_proc procedure call:
------------------------------
ad_proc -public switch{
allowed
restricted
}{
....
}
{
set allowed_options ""
set restricted_options ""
foreach option $allowed{
append allowed "<option>$option</option>\n"
}
foreach option $restricted{
append restricted "<option>$option</option>\n"
}
set widget {
....
<form>
<select name="list" multiple="multiple"
<option>$allowed</option>
</select>
</form>
....
}
} return "$widget"
}
This does not work. It returns a select box with only the value "$allowed". Can someone please tell me what I am doing wrong as I am a newbie. Thanks in advance.