troubleshooting Question

cant seem to get value out from form

Avatar of icepricessa
icepricessa asked on
Web Languages and Standards
6 Comments1 Solution199 ViewsLast Modified:
Hi there I found this javascript and used it to create this select box where by the user can select what they want to delete. those that they have selected will be moved to the box on the right. However, the value does not seem to be passing over. How can I go about this? all help is greatly appreciated  
[code]      
<script language="Javascript">
<!--
function ClearList(OptionList, TitleName)
{   OptionList.length = 0;
}
  function move(side)
      {   var temp1 = new Array();
           var temp2 = new Array();
                  var current1 = 0;
           var current2 = 0;
           var attribute;
//assign what select attribute treat as attribute1 & attribute2
if (side == "right")
{  attribute1 = document.selectBoxID.Box_Number;
   attribute2 = document.selectBoxID.Box_selected;
                  }
                  else
      {  attribute1 = document.selectBoxID.Box_selected;
       attribute2 = document.selectBoxID.Box_Number;  
      }
      //fill an array with old values
      for (var i = 0; i < attribute2.length; i++)
      {  temp1[current1++] = attribute2.options[i].value;
      }
      //assign new values to arrays
      for (var i = 0; i < attribute1.length; i++)
      {   if ( attribute1.options[i].selected )
       {  temp1[current1++] = attribute1.options[i].value;
      }
            else
      {  temp2[current2++] = attribute1.options[i].value;
                        }
                  }
      //generating new options
            for (var i = 0; i < temp1.length; i++)
                {  
          attribute2.options[i] = new Option();
                  attribute2.options[i].value = temp1[i];
                   attribute2.options[i].text =  temp1[i];
                }
                  //generating new options
                  ClearList(attribute1,attribute1);
                  if (temp2.length>0)
                  {      
                for (var i = 0; i < temp2.length; i++)
                {   attribute1.options[i] = new Option();
              attribute1.options[i].value = temp2[i];
              attribute1.options[i].text =  temp2[i];
                      }
                  }
            }
            
            
      //-->
      </script>
[/code]

[code]
<table>
      <tr>
           <td>
       <select name="Box_Number" id="Box_Number" multiple size="5" style="width=150px" width="150px">
                 <%      
sql = "SELECT BoxID FROM Serial where PurchaseID="&purchase&" Group BY BoxID;"
Set RS = objConn.Execute(sql)
                                           Do While not RS.EOF
                                           %>
               <option value="<%=RS("BoxID")%>"><%=RS("BoxID")%></option>
                        <%
                                                RS.MoveNext
                                                Loop
                                                RS.Close
                                                Set RS = Nothing
                                          %>
                      </select>
                    </td>
                    <td>
              <input name="button" type="button" onclick="move('right')" value=">>">
                      <br>
                      <input name="button" type="button" onclick="move('left')" value="<<">
                    </td>
                    <td>
     <select name="Box_selected" multiple size="5" style="width=150px" width="150px">
                      </select>
                    </td>
                  </tr>
                </table>
[/code]
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 6 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 6 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros