Forum OpenACS Q&A: ad_form trouble creating text select

ad_form  -name filtri_bk -form {\
    {bk_fatture_f:text(select) \
     {label bk_fatture_f} \
     {options {10 20}} \
     {value {10 20}}}}

give the following html code:

<select name="bk_fatture_f" >
<option value="">10</option>
<option value="">20</option>
</select>

I would like to have values in value field like following snippet:

<select name="bk_fatture_f" >
<option value="10">10</option>
<option value="20">20</option>
</select>

Is there a correct way to use ad_form in order to accomplish
this request?

Thanks a lot

Collapse
Posted by Antonio Laterza on
I found a response following this thread:
https://openacs.org/forums/message-view?message_id=120754

In details here:
http://cvs.openacs.org/cvs/openacs-4/contrib/packages/project-manager/

In  task-add-edit.tcl .

So I changed my code:
ad_form -name filtri_bk -form {\
    {bk_fatture_f:text(select) \
     {label bk_fatture_f} \
     {options {{10 10} {20 20}}} \
     {value t }}}

And finally the result was:

<select name="bk_fatture_f" >
<option value="10" selected="selected">10</option>
<option value="20">20</option>
</select>

Wow!