No, if you want that option selected pass it a attribute for selected.
Anything with an underscore will get passed to the html as an attribute. So
you could also go _style="..."

OPTION('candy', _selected="selected", _value=1) should produce what you are
looking for.

However, when using SQLFORM the default selection can be set as well when
you specify field.default =...

-Thadeus




On Wed, Oct 21, 2009 at 9:26 PM, Avik Basu <[email protected]> wrote:

>
> Hello,
>
> I am a Web2Py newbie trying to use the OPTION helper to create a
> dropdown menu that will select the appropriate option.
>
> I expect that
>
> OPTION('candy', _value=1, value=1)
>
> should produce
>
> <option selected="selected" value="1">candy</option>
>
> but it only produces
>
> <option value="1">candy</option>
>
> Am I doing something wrong? Thanks.
>
> Avik
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to