Form Submit, Dynamic Dropdown

Discussion in 'ASP General' started by Jeff Uchtman, Nov 14, 2005.

  1. Jeff Uchtman

    Jeff Uchtman Guest

    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
    Jeff Uchtman, Nov 14, 2005
    #1
    1. Advertising

  2. Jeff Uchtman wrote:
    > 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
    --
    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"
    Bob Barrows [MVP], Nov 14, 2005
    #2
    1. Advertising

  3. Jeff Uchtman

    Guest

    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

    > 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.
    , Nov 14, 2005
    #3
  4. Jeff Uchtman

    Guest

    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

    > 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.
    , Nov 14, 2005
    #4
  5. Jeff Uchtman

    Jeff Uchtman Guest

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

    <> wrote in message
    news:...
    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

    > 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.
    Jeff Uchtman, Nov 14, 2005
    #5
  6. Oh! I was thinking he wanted to get the SELECT element's id attribute ...

    wrote:
    > 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
    >
    >> 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.


    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.
    Bob Barrows [MVP], Nov 14, 2005
    #6
  7. 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 ... )

    wrote:
    > 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
    >
    >> 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.


    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.
    Bob Barrows [MVP], Nov 14, 2005
    #7
  8. Jeff Uchtman

    Jeff Uchtman Guest

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

    Jeff


    "Bob Barrows [MVP]" <> wrote in message
    news:...
    > 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 ... )
    >
    > wrote:
    >> 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
    >>
    >>> 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.

    >
    > --
    > Microsoft MVP -- ASP/ASP.NET
    > Please reply to the newsgroup. The email account listed in my From
    > header is my spam trap, so I don't check it very often. You will get a
    > quicker response by posting to the newsgroup.
    >
    >
    Jeff Uchtman, Nov 17, 2005
    #8
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.

Share This Page