I have a web form with a drop down menu which allows the user to select multiple items from a list. How do I parse the results? For example:
<select multiple size="5" name="genbank_info">
<option value="genbank_none" selected>none</option>
<option value="gi_number">gi number</option>
<option value="protein_seq">protein sequence</option>
<option value="dna_seq">DNA sequence</option>
<option value="genbank">genbank file</option>
<option value="locus_link">locus link</option>
</select>
If the user selects "gi_number" and "protein_seq", how do I do something with BOTH these values? I can only seem to get access to the last selected value at the moment because all I know how to do is something like
if ($FORM{'genbank_info'} eq "gi_number"){
$gi_number = "1234";
}
but obviously a string can't equal 2 things at once.
Thanks!
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.