Form Submit, Dynamic Dropdown

J

Jeff Uchtman

I know I have done this but my mind is fried. I have a dynamic dropdown in
a form. I need to pull both the dynamic dropdown's ID and name listed in
the dropdown. Need a little help with grey matter tonight.

Thank
Jeff
 
B

Bob Barrows [MVP]

Jeff said:
I know I have done this but my mind is fried. I have a dynamic
dropdown in a form. I need to pull both the dynamic dropdown's ID
and name listed in the dropdown. Need a little help with grey matter
tonight.

In server-side code? The only thing passed from your html during a
submission to the server-side code is the name-value pairs found in either
the Form or Querystring collections. You can't even tell the type of
controls that were the source of the name-value pairs.

Unless you store the ID's in a hidden field*, perhaps using xml, there is no
way to determine the ID's in server-side code.

Bob Barrows
* or make the ID's the same as the names - not recommended
 
P

paul

Perhaps store both the ID and the name in the value part such as
"345|Smith Company"

Best regards,
J. Paul Schmidt, Freelance Web and Database Developer
http://www.Bullschmidt.com
Access Database Sample, Web Database Sample, ASP Design Tips
 
P

paul

The ususal thing I do is just to get the ID and then look up the name
(from the database) on the later Web page that needs that info.

Best regards,
J. Paul Schmidt, Freelance Web and Database Developer
http://www.Bullschmidt.com
Access Database Sample, Web Database Sample, ASP Design Tips
 
J

Jeff Uchtman

That was it. Pass both values and split on database entry. That worked
great.
Thanks
Jeff

Perhaps store both the ID and the name in the value part such as
"345|Smith Company"

Best regards,
J. Paul Schmidt, Freelance Web and Database Developer
http://www.Bullschmidt.com
Access Database Sample, Web Database Sample, ASP Design Tips
 
B

Bob Barrows [MVP]

Oh! I was thinking he wanted to get the SELECT element's id attribute ...
 
B

Bob Barrows [MVP]

Exactly. I can't think of a situation where I would need to pass both values
in the form submission (which is why I thought he was talking about the
SELECT element's id ... )
 
J

Jeff Uchtman

Its a dynamic dropdown from another table. I need to pass two elements from
that table to the submint form. SPLIT worked great!

Jeff
 

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

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,043
Latest member
CannalabsCBDReview

Latest Threads

Top