Sop215 0 Newbie Poster

Hi All

Anyone knows how do i store the selected value into a hidden field or variable so that i can use it for database insert ? Btw this is in ASP.

I took the jquery sample code from:

http://www.ajaxshake.com/en/JS/232761/a-progressive-enhancement-to-select-multiple-form-elements-asmselect.html

Here is my code:

<script type="text/javascript">
$(document).ready(function() {			
		$("#Part_ID").asmSelect({
		addItemTarget: 'bottom',
		animate: true,
		highlight: true,
		sortable: true
})			

       .after($("<a href='#Part_ID'>Select All</a>").click(function() {
	 $("#Part_ID").children().attr("selected", "selected").end().change();
			return false;			
	})); 	
				
				
				 $('#other').click(function () {
          $('.target').change
        })
</script>
<tr class="cellcolor">
         <td align="right" class="style4">
      <font color="#FF0000"><b>*</b>&nbsp;</font><b>Part Name:</b>
    </td>
    <td>
          <label for="Part_ID">Parts for this Product:</label>
		
            <select id="Part_ID" multiple="multiple" class="target" title="Click to Select the Part Name">

		  <%
                     If not isnull(Part_ID) then
		  	 arrtemp = split(Part_ID,",")
		  	   End If 
				While (not RS.eof)
			response.write "<option value=""" & RS("Part_ID") & """ "
				if ubound(Filter(arrtemp, "Part_ID"))>0 then
					if (cstr(Part_ID)=cstr(RS("Part_ID"))) then
							response.write "selected"
					end if
				end if
				dim ptName
				   ptName=RS("strPart")					
				response.write " >" & ptName & "</option>"	
			RS.movenext						
		   wend				
      		%>	
             </select>
		<input id="text1" type="text"/>
			<div id="other">
			</div>
    </td>  
</tr>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.