Forum OpenACS Development: Preselecting an option in ad_form

I need to put a select widget in an ad_form, I have the list of options.
All well till there, it works fine.

I also want a specific option to be preselected. How do I do that in an ad_form?
I know how to do that in normal html....but I cannot find how to do it in ad_form

Thanks,
Konstantinos

Collapse
Posted by Anny Flores on
Hi,
I think that you should only add the "value" parameter to the element of the form like this:

ad_form -name form_name -form {
{element_name:text(select)
  {label "element_label"}
  {options $options}
  {value $value}
  ...

  }
  ...
}

I hope this helps you!

Collapse
Posted by Konstantinos Kokkorogiannis on
Thank you very much,
that did the trick 😊
Be well,
Konstantinos