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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multi-select List, select all problem 1

Status
Not open for further replies.

scuttleButt

Programmer
May 17, 2000
44
0
0
US
I am working in vbscript, ASP pages, SQL 2000 backend. I have 2 multi-select list boxes working together. One list is selUnused for unused codes and the other list is, selSelected for the codes selected. The user can move the codes between the two lists while they are deciding which codes they want to select. They work fine and I can get data from them but what I really want to do is add a database record for EVERY code in the selSelected list.

I Know that I have a response.write not an insert but this is simply to illustrate...

For a = 1 to Request.Form("selSelected").Count
Response.Write(&quot;The code&quot; & Request.Form(&quot;selSelected&quot;)(a) & &quot; was selected<BR>&quot;)
Next

In order to write each code in the list I have to actually select them but in my screen if they are in the selSelected list they are already selected. How can I get to everything in the selSelected list?

Any ideas will be appreciated I have been beating my head against the wall on this one. Thanks!
 
before you submit the form call a javascript function to select all items in the list

function submitIT()
{
//select all items in the list - wont be picked up by asp if not
for(var i=0; i<this.formname.listname.options.length; i++)
{
this.formname.listname.options.selected = true
}

this.formname.submit
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top