Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Request.form(listbox)

Reply
Thread Tools

Request.form(listbox)

 
 
Mark Tait
Guest
Posts: n/a
 
      09-02-2003
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[i].selected) {
newOpt=field1.options[i].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
http://www.velocityreviews.com/forums/(E-Mail Removed)
www.fixitks.co.uk

Mark Tait
(E-Mail Removed)
www.fixitks.co.uk

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Reply With Quote
 
 
 
 
Bob Barrows
Guest
Posts: n/a
 
      09-02-2003
Mark Tait wrote:
> 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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off




Advertisments