This topic is locked

multiselect for many-to-many in add and edit page

1/29/2009 4:54:24 AM
PHPRunner General questions
K
kadidarm author

multiselect for many-to-many in add and edit page
is there a way to do this? I can do this easily in MS access

J
Jane 1/29/2009

Hi,
to set up multi-select dropdown on the add/edit pages set up field as Lookup wizard on the "Edit as" settings dialog on theVisual Editor tab and turn on Multiline option.

G
guy 1/29/2009

Hi,

to set up multi-select dropdown on the add/edit pages set up field as Lookup wizard on the "Edit as" settings dialog on theVisual Editor tab and turn on Multiline option.


Hi Jane,
Is there any way to have a multi select option on the advanced search page then?

K
kadidarm author 1/30/2009

Hi,

to set up multi-select dropdown on the add/edit pages set up field as Lookup wizard on the "Edit as" settings dialog on theVisual Editor tab and turn on Multiline option.


Hi Jane,

yes you can do multiselect but the result of the multiselect is not saved in the database. How to save the result of multiselect?

J
Jane 1/30/2009

Hi,
please make sure this field where you want to save selected values is set up as varchar in the database.

vin7102 1/30/2009

Hi
I think this topic was brought up before but has anyone ever figured out a work-around to do a multi select on an add page and have a separate database entry created for each item selected?

I believe its possibly in line for a future update but it sure would be great to have this included into my application before I go through the whole training and deployment process for my company!
Thanks

J
Jane 1/30/2009

Vince,
to save each value as separate record parse value in the event and save it manually.

K
kadidarm author 1/30/2009

any suggestions on code for this?

vin7102 1/30/2009

Hi Kris,
I'm trying to modify some code to parse the selections as I write this. I'll give you an update here in a bit.
This is what I have so far but its throwing some errors that I need to figure out..
This would go in the Before Record Added and Before Record Updated events

global $conn;

if ($values["Employee_Name"])

{

$arr = explode(",",$values["Employee_Name"]);

for ($i=0;$i<count($arr);$i++)

{

$strInsert = "insert into payroll_main (Employee_Name) values ('".$arr[$i]."')";

db_exec($strInsert,$conn);

return false;

}

}

T
thesofa 2/3/2009

OK, I needed to add a series of records to a child table from a master record table

the master table is of kids names, the child table is of detentions.

Here is the link of how I did it