Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ASP List Filling

Status
Not open for further replies.

Cassien

Programmer
Sep 17, 2002
94
0
0
Does anyone have any ideas about filling the two boxes on this page


Users select items from the left box to move to the right box and can then update their record. The left box is populated by an options list and at present the right box can only be populated by moving data from the left box.

I would like to populate the right box from a db at the start and remove the duplicate option from the left hand box.

Hope that makes sense!

Any ideas?
 
i think this is what u want:

after the use updates the info once the next time he comes to the page only those he had selected must come in the right box others in the left box...

Known is handfull, Unknown is worldfull
 
yeah, I have the database all set up and that query does update the relevant fields. But I can't think of a way to do what you said basically...
 
suggestions for method of attack :

1. profiled environments in the DB ( easiest, not wisest cause of DB traffic would become horrendous ) basically assign each user ( guessing they log in , the link didn't work for me ) use they're Unique DB ID to reference them to another table containing the selections they moved to the right, insert only when that selection isn't present in the dataset from the profiled info in the profile table that way there are no dupes

2. write the duplicate handling in the page, show all changes in the web page, when the client is happy with left and right list, then submit it to the DB ( less DB traffic, more code )

3. Javascript handle moving it around side to side use Multi selects on both sides, and update the Select contents of the right side with document modifications ( ALOT MORE code, but all client side until client is happy with selections then it's pushed to database )

but the storage of the profiled information (list selections) is a cross reference table containing 2 fields, both numeric data types, one field is the client unique ID from the users table, second field is the unique ID from the List items table, storing a profiled selection set from the user, you can then use this recordset to pull into an array (after doing select Distinct, hence clearing the dupes) store the array temporarily while you delete the records from the profile info, then cycle the array to re-insert or do a batch insert to clear your dupes, or use stored proceedures for cleanup.

hope the info helps
 
is the info in the list box coming from a database or is it hardcoded?

Known is handfull, Unknown is worldfull
 
Thanks for your help on both of those... I've got solved it now thankfully.

Just for anyones interest I...

drew the right hand box from a db and compared it in a loop to the users existing data. i.e. I looped through all the potential items and only selected them if they did not equal an existing value.

Using Javascript I swaped data between the list of choices and the users selected items.

Also in Javascript I built the SQL string using the data from the selected choices.

I passed the SQL string back as a form variable and use ASP to write pass it to my server. Seems to work quite well, and certainly a great deal faster than the ten pull down boxes it replaces !!

Anyone who wants to see any of the code it welcome, just message me on here.

Thanks for everyones help,

John
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top