You can also try to use the -extend function to dynamically build the form.
Then do something like this in your ad form
ad_form -name myform -form {
{somekey:key}
{sometextbox:text(text) {label "some textbox"}
}
Then inside the code logic you have for generating the select boxes you just extend the form.
if { $codelogic } {
{selectitem:integer(select)
{label "select item"}
{options $my_option_list}
}
} else {
{otherselectitem:integer(select)
{label "other select item"}
{options $other_my_option_list}
}
}
I hope this helps.