If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Problem after moving data between select boxes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-28-03, 02:41
simonfinn simonfinn is offline
Registered User
 
Join Date: Oct 2003
Posts: 22
Problem after moving data between select boxes

Hi

I have used ASP code to load data into two select boxes. The code below is
used to move the selected data back and forth between the boxes.

I am having problems retreving the data from the boxes after the user has
moved any of the data:

If the data has been moved by the below code; when i try and load the data
back into the database i cannot retrieve the data using:
request.form("Clients1").item(1) and it will not show up using
request.form("Clients1").count

If i dont move the data i can retrieve it using:
request.form("Clients1").item(1)

This is confusing me some what, any help would be great.

Thanks Si.

Here is my code:

<FORM id="myForm" name="myForm" method="post" action="SaveITSkills.asp">
<SELECT id=clients1 style="WIDTH: 160px; COLOR: black; HEIGHT: 266px"
multiple size=5 name=clients1><%=optionStr%></SELECT>
<INPUT onclick="moveIt('del',document.myForm.clients2.sel ectedIndex)"
type=button value="Include" style="WIDTH: 61px; HEIGHT: 22px" size=51>
<INPUT onclick="moveIt('add',document.myForm.clients1.sel ectedIndex)"
type=button value="Exclude" style="WIDTH: 61px; HEIGHT: 22px" size=52>&nbsp;
<SELECT id=clients2 style="WIDTH: 160px; COLOR: black; HEIGHT: 264px"
multiple size=5 name=clients2><%=option2Str%></SELECT>
<INPUT type=submit value=Save name=Save action="myform.submit();">
<SCRIPT language=JavaScript>
function moveIt(action, thisOption){
if (thisOption == -1){
return false;
}
if (action == 'add'){
c2 = document.getElementById("clients2")
c2.options[c2.options.length] = new Option
(document.myForm.clients1[thisOption].text,
document.myForm.clients1[thisOption].value)
c1 = document.getElementById("clients1")
c1.options[thisOption] = null
}
if (action == 'del'){
c1 = document.getElementById("clients1")
c1.options[c1.options.length] = new Option
(document.myForm.clients2[thisOption].text,
document.myForm.clients2[thisOption].value)
c2 = document.getElementById("clients2")
c2.options[thisOption] = null
}
}
</SCRIPT>
</FORM>
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On