Hey,

I have a need to allow the user to select multiple countries for a
single record (in this case the record is a project - which could be
occurring in a number of different countries).

I've developed a widget which allows the user to select a country from
a drop down, then click a button which uses JS to add it to a table
within the widget and also selecting it on a hidden web2py multiple
widget. The hidden multiple widget ensures that the values are saved
with the form.
Similarly, there is a "x" next to each country which has been selected
and is displayed on the table, which will run some JS to remove it
from the table, and de-select it on the hidden widget.

This code is working, but I have a few questions:

* Is it fine to presume that all users will be able to use JS on their
browsers?
* Is there a better way to do this type of functionality rather than
using a hidden multiple widget? Could the selected countries be read
directly from the table? Would it be more efficient to use a hidden
string widget? Where is the code which gets the values from the table
and saves them to the DB?
* Is there any dangers/issues/considerations in using a field with
multiple = True, rather than using a linking table for many to many
relationships? Or even using a field with multiple = True for a one to
many relationship?

Please let me know if it would simplify matters (or somehow
contribute) if I shared my code (web2pyslice?).

Cheers

Michael


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

Reply via email to