View Full Version : values in a listbox

01-07-2004, 03:12 PM
Hi there i was wandering if anybody could help me with this problem. I've created a list box that the user can enter values in using javascript. but i cant grab any of the informationed when the data is posted. Is it possible to grab all the information and if yes how can this be done. Thanks attached below is a snippet of my code: -

<select name="Attributes_chosen[]" multiple size="5">

var group=new Array()
group[0]=new Option("problem_number")
group[1]=new Option("crstatus")

var temp=document.forms[0].elements['Attributes_chosen[]']

function change(){

var sel = document.CreateQuery.Attributes;
var opt = sel.options[sel.selectedIndex].text;

group[group.length]= new Option(opt);

for (m=temp.options.length-1;m>0;m--)
for (i=0;i<group.length;i++){
temp.options[i]=new Option(group[i].text,group[i].value)


01-08-2004, 05:14 AM
one way, would be to add what they do to a variable, and store that variable as a value of hidden form element...like such:

<input type="hidden" name="user_added">

document.user_added.value += "text=" + group[i].text + "value=" + group[i].value

when it's submitted, php could access the value "user_added"

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum