Forum OpenACS Development: ad_form select widget option labels don't like spaces

I can't seem to get ad_form to let me have spaces in the label of a select widget, eg:

{frequency:integer(select) {label "Frequency"}
        {options {"1 min"  1}  {"5 min" 5}
        {"10 min" 10} {"15 min" 15}
        {"30 min" 30} {"1 hour" 60}
        {"5 hours" 300} {"12 hours" 720}
        {"24 hours" 1440}}}

renders as:

<select name="frequency" >
  <option value="min" >1</option>
  <option value="" >1</option>
</select>

Unless I am doing something stupid, I will log a bug.

I'm stupid - and i've fallen for this before when using a db_list_of_lists to build options.

The observant among you will notice that there are no braces grouping all of the options together into a list. The code should read:

{frequency:integer(select) {label "Frequency"}
        {options {{"1 min"  1}  {"5 min" 5}
        {"10 min" 10} {"15 min" 15}
        {"30 min" 30} {"1 hour" 60}
        {"5 hours" 300} {"12 hours" 720}
        {"24 hours" 1440}}}}
Collapse
Posted by Don Baccus on
Don't feel bad, I made the same mistake last week when writing a form handling page.  Oops :(