I want to know is The only way to make multi-select list is to have bridge table betwwen two tables??
I have tables (member,language,member_language)--> each member has one or more than one language i made a multi-select list of longuages, and i selected the more than languge it works fine.
But i wanna to make the same thing into regions table but here the member has only one region so when i select more than one region from multi-select list of regions it cause an error "value not in database!", and when i select one value from regions list it works fine.
i wanna only to have a list of regions that i can select more than one region to generate a report that satisfy the selected regions, i will not insert any selected regions into database, i will use them into my query only.
How can i do this??
my code:
database part
db.define_table("region_tmp",
SQLField("name","string")) db.region_tmp.name.requires = IS_IN_DB(db,'region_tmp.name',multiple=True)
form part:
form=SQLFORM(SQLDB(None).define_table('myform',
db.region_tmp.name,,submit_button="Generate Report")
The output of my code is multi-select list of regions when i select more than one region from regions list The form display "value not in database!" message under regions list and when i select one region from regions list it works fine and the report is generated.
Thanks In Advance