In my app I have this:

    cf = db.contacts.fields
    form = FORM("Field:",SELECT(cf, _name="field", requires = IS_IN_SET( cf 
), _value="last_name"),
                "(Exact match?)", INPUT( _type="checkbox", _name = 'exact', 
_value = True),
                "Search for (required):", INPUT( _type="text", _name= 
'search', requires = IS_NOT_EMPTY() ),
                INPUT( _type="submit", _value="SEARCH"))

which is intended to generate a generic search form. And, in fact, it does.

I have two problems with giving the for, default values though. I want the 
"field" field to have "last_name" selected by default. It does, but only 
after the first submission of the form - when the page is first loaded, the 
first field (id) is selected.

And I can't seem to set a default value for the checkboc - I want it 
selected by default - despite trying several possibilities, like _default 
and so on. 

Can't seem to find this in the documentation. How is it properly done?

thanks

Daniel


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to