"but now i want to pass this value in a php function. tht in turn will give me another list."
can you be a little clearer? you want to pass an array of data from a listbox to php, and create another listbox from that php array?
you'll have to submit the page obviously, to get the value from javascript to php. if the list box is multiselect, you'll pass it as an array.
<INPUT TYPE="button" NAME="submitted" value="Set List" onClick="selectAllOptions(this.form.elements['sr_list[]']); this.form.submit();">
javascript function:
function selectAllOptions(obj) {
for (var i=0; i<obj.options.length; i++) {
obj.options[i].selected = true;
}
}
you now have a php variable, an array: $_POST['sr_list']
then you can do what you want with it.