how to get select text in a form?

Discussion in 'HTML' started by lli@sos.state.tx.us, Dec 14, 2005.

  1. Guest

    Hi Guys,


    I built a select in a form. My select is:
    print '<SELECT NAME="county">'
    print '<OPTION VALUE="000">ALL'
    print '<OPTION VALUE="001">AAA'
    print '<OPTION VALUE="002">BBB'
    print '</SELECT>'


    I can get which item value users select. For example users select item
    2, I can get its value "001". But now I want to get item text "AAA",
    not its value "001". How I can do this. I use CGI, HTML and python to
    code.


    Any help is appricated.


    LLI
     
    , Dec 14, 2005
    #1
    1. Advertising

  2. wrote:
    > print '<OPTION VALUE="000">ALL'
    > I can get which item value users select. For example users select item
    > 2, I can get its value "001". But now I want to get item text "AAA",
    > not its value "001". How I can do this. I use CGI, HTML and python to
    > code.


    You can't get it from the data submitted. If you generate your form
    programatically, you can use the same data source as you used to generate
    your form to work out what value corresponds to what text. (Or you could
    just not set a value and use the text itself as the form data).


    --
    David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
    Home is where the ~/.bashrc is
     
    David Dorward, Dec 14, 2005
    #2
    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.
Similar Threads
  1. Michael Reiche
    Replies:
    3
    Views:
    10,853
    Michael Reiche
    Feb 5, 2004
  2. yawnmoth
    Replies:
    2
    Views:
    458
    Peter Flynn
    Aug 18, 2008
  3. Marco Krechting

    Get text from SELECT into hidden text?

    Marco Krechting, Jan 9, 2005, in forum: ASP General
    Replies:
    5
    Views:
    185
    Aaron [SQL Server MVP]
    Jan 10, 2005
  4. palmiere
    Replies:
    1
    Views:
    412
    Erwin Moller
    Feb 9, 2004
  5. Replies:
    4
    Views:
    234
    Thomas 'PointedEars' Lahn
    May 9, 2005
Loading...

Share This Page