Setting options in IS_IN_SET() as links to pages with more links

21 views
Skip to first unread message

mostwanted

unread,
Jul 9, 2020, 6:24:50 AM7/9/20
to web...@googlegroups.com
Hi guys, is it possible to set options in the IS_IN_SET() validator as links to pages with more links related to the ones in the validator?
I have a table that registers students, the requirements for the app are that all progams should be available for selection in the form field of Program_of_Study in a dropdown format, the problem is that they are too many, waaay too many to be listed in a dropdown, so I was wondering if i could have levels (Certificate, Diploma, Degeree, Masters, PhD) in the IS_IN_SET() validator but as links & when someone selects Diploma it re-directs them to a page of Diploma programs allowing them to select the program they want by clicking on it & then getting redirected back again to the form to complete the form, something like below

Code Example in the MODEL
db.define_table('links',
               
Field('name', requires=IS_IN_SET([('certificate', _href=URL('default', 'certificate_programs')), ('diploma', _href=URL('default', 'diploma_programs')), ('degree', _href=URL('default', 'degree_programs'))], zero='---Select Level of Study---')))

If the above is not possible at all whats an alternative to solving my challenge (With examples please ☺)
Regards;

Mostwanted

AGRogers

unread,
Jul 10, 2020, 2:04:41 AM7/10/20
to web...@googlegroups.com
I solved the challenge of having too many options  by using the multiselect option recommended in the book.
"We strongly suggest using the jQuery multiselect plugin to render multiple fields."

It's designed for multiselect obviously but i don't see why it  couldn't be adjusted to be used as a nice way of searching for and selecting a single option.


If the above is not possible at all whats an alternative to solving my challenge (With exaples please &#128522)
Regards;

Mostwanted

--
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+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/0562362a-2de5-44eb-8718-efdbd43436e1o%40googlegroups.com.

mostwanted

unread,
Jul 10, 2020, 7:27:28 AM7/10/20
to web2py-users
Great stuff @ AGRogers
To unsubscribe from this group and stop receiving emails from it, send an email to web...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages