Making dependent form fields in web2py

126 views
Skip to first unread message

aabhas majumdar

unread,
Oct 29, 2013, 8:39:20 AM10/29/13
to web...@googlegroups.com
I have to create a form which has 2 fields source and destination . I have a table Location1 in db.py with source and destination .
I wanted to implement the view such that if i select a source from the drop down list of source then in destination only those destinations will be in drop down list whose source in database is the source entered.
Example:
database:
 SOURCE - DESTINATION
 USA        -   INDIA
 USA        -    JAPAN
 INDIA       -   CHINA
 JAPAN     -   CHINA

now in views if i select USA in SOURCE from dropdown list  of("USA","INDIA","JAPAN")  my destination dropdown list should contain only ("INDIA","JAPAN")

Anthony

unread,
Oct 29, 2013, 8:52:43 AM10/29/13
to web...@googlegroups.com

aabhas majumdar

unread,
Oct 29, 2013, 8:58:32 AM10/29/13
to web...@googlegroups.com
Thanx a million :) !!


--
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 a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/3nXMvNZUfuY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply all
Reply to author
Forward
0 new messages