Because if

    form[0][1][1][0]

is a select

    form[0][1][1][0][i]

are the options. It is the option['_value']=='Pc' that has has to be
option['_selected']='selected'.
The best way to handle is to do

    form[0][1][1][0]['value']='Pc'

before form.accepts and the proper option will be selected
automatically.


You can also do this manually in two ways:

    form[0][1][1][0]['value']='Pc'
    form[0][1][1][0]._postprocessing()

and

    for option in form[0][1][1][0]:
         option['_selected']=='selected'] if option['_value']=='Pc'
else None

You should never need to get to this low level of programming anyway.
This may mess up automatic form handling.

Massimo





On Nov 13, 3:03 am, pmate <[EMAIL PROTECTED]> wrote:
> Hi,
> in a form, for a dropdown select control:
> form[0][1][1][0]['value']='Pc'
>
> doesn't work. What i mean is that the value is set to 'Pc' but it
> doesn't show selected.
> If it is, instead, a text one, it works perfectly.
>
> Where do i go wrong?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" 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