Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Loop Form - extract display 'value' as well as form value?

Reply
Thread Tools

Loop Form - extract display 'value' as well as form value?

 
 
Guest
Posts: n/a
 
      02-20-2006
While I can extract the option value from the following:

<Select name='Keystring' MULTIPLE>
<option value='1' name='status'>Pending</option>
.....
</select>

I cannot seem to extract the corresponding 'display' value when I do a
For...Next Loop:

for each keystring in Request.Form("Keystring")

keystring=request("keystring")

Next

How do I aslo get hold of that 'display' value eg 'Pending'...is it
possible?

Thanks
Jason


 
Reply With Quote
 
 
 
 
Paxton
Guest
Posts: n/a
 
      02-20-2006

<(E-Mail Removed)> wrote:
> While I can extract the option value from the following:
>
> <Select name='Keystring' MULTIPLE>
> <option value='1' name='status'>Pending</option>
> ....
> </select>
>
> I cannot seem to extract the corresponding 'display' value when I do a
> For...Next Loop:
>
> for each keystring in Request.Form("Keystring")
>
> keystring=request("keystring")
>
> Next
>
> How do I aslo get hold of that 'display' value eg 'Pending'...is it
> possible?
>
> Thanks
> Jason


You can't. If you want to retrieve "Pending", make it the value. Why
have you got a value of 1? Does it relate to a database key?

Incidentally, the <option> element does not have a name attribute, so
name='status' serves no use to you at all.

/P.

 
Reply With Quote
 
 
 
 
Bob Barrows [MVP]
Guest
Posts: n/a
 
      02-20-2006
http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:
> While I can extract the option value from the following:
>
> <Select name='Keystring' MULTIPLE>
> <option value='1' name='status'>Pending</option>
> ....
> </select>
>
> I cannot seem to extract the corresponding 'display' value when I do a


Of course you can't. That is not a piece of information that is passed along
with a form submission. Only form values are sent.

>
> How do I aslo get hold of that 'display' value eg 'Pending'...is it
> possible?
>

Several options:
a. Store it in a hidden field - downside: more html sent to client
b. Create a 2-dimensional array containing all the data used to build your
option elements. Store it in Session or Application, depending on the
volatility of your data - downside: arrays are not easy to search without
possibly looping through all te elements
c. Create an xml document containing all the data used to build your option
elements. Either store it in a file, in Session, or in Application depending
on the volatility of the data - downside: learning curve if you've never
used the xml parser

Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"


 
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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Triple nested loop python (While loop insde of for loop inside ofwhile loop) Isaac Won Python 9 03-04-2013 10:08 AM
How do i extract vidios when winrar wont extract them??? help plzzzzzzzz smuttdog@sc.rr.com Computer Support 2 12-23-2007 07:03 AM
Radio Button Loop inside Form Element Loop wreed Javascript 9 10-16-2006 01:39 PM
Hi Whats considered to be a well priced and well reviewed plasma tv 42 inch and above ? Hmmmmmmm DVD Video 8 09-28-2004 09:32 AM
help: loop within a loop -how to display data in 3 columns by 4 rows format addi ASP General 0 12-31-2003 04:31 AM



Advertisments