Request.form(listbox)

M

Mark Tait

Hi - I'm using the function below, to add items from one list box, to
another - however, when I post the page back to iteself (ASP) and do a
request.form, it does not pick up any items in the second list - because
they're not hilighted when the page is posted.

Is there a way of picking up the items in the list, regardless of
whether they are selected ot not?

Thanks for any help, Mark



<SCRIPT LANGUAGE="JavaScript">
<!--

function Populate() {
frm=document.forms[0]
field1=frm.txtaddresslist
field2=frm.txtmemb

for(i=0, j=0;i<field1.length;i++) {
if(field1.options.selected) {
newOpt=field1.options.text
// a=field2.length
// alert(a)
// field2.length++
alert(field2.length)
a=field2.length
field2.options[a]= new Option(newOpt,newOpt)
j++
}
}
}

// -->
</SCRIPT>

Mark Tait
(e-mail address removed)
www.fixitks.co.uk

Mark Tait
(e-mail address removed)
www.fixitks.co.uk
 
B

Bob Barrows

Mark said:
Hi - I'm using the function below, to add items from one list box, to
another - however, when I post the page back to iteself (ASP) and do a
request.form, it does not pick up any items in the second list -
because they're not hilighted when the page is posted.

Is there a way of picking up the items in the list, regardless of
whether they are selected ot not?
No. The only data submitted by a form is data that is entered or selected by
the user. If the responding page needs to know all the items in the list,
you have to supply them either in the responding page, or use a hidden
textbox in the form that contains all the items. Hey! you could create a
hidden copy of the listbox that has all the values selected! Try that.

Bob Barrows
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top