how to get select text in a form?

L

lli

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
 
D

David Dorward

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).
 

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

Forum statistics

Threads
473,756
Messages
2,569,533
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top