Solved

Drop down menu value

Posted on 2004-10-07
1
165 Views
Last Modified: 2010-04-17
How do I read the value of a drop down menu in a cgi script.  I can read all the other value except the drop down menu.  Here is some of the HTML code that sets values for drop down

sub print_html {
        print "Content-type: text/html\n\n";
        print "<html>\n<head>\n";
        print "<title>Add IAVA Form</title>\n</head>\n<body bgcolor=#FFFFFF>\n";
        print "<h3 align=center> <i>IAVA Reporting System</i><h3></center>\n";
        print "<h3 align=center> <i>All fields must be populated</i><h3></center>\n";
        print "<FORM NAME=\"addform\" METHOD=\"post\" action=\"/cgi-bin/iava_add.pl\">\n";
        print "<table border=0 align=center>\n";
        print "<tr><td>IAVA ID:";
        print "<SELECT NAME=iava_id</td>";
        print "<OPTION VALUE>Select IAVA";
        while ($row = $sth->fetchrow()) {
                $iava_id = $row;
                print "<option VALUE=\"$iava_id\">$iava_id</option>\n";
        }
        print "</select></tr>\n";
        print "<tr> <td>Command(AOR):</td>\n";
        print "<td><input type=\"text\" NAME=\"command\" size=20 maxsize=20 ></td> </tr>\n";
        print "<tr> <td>System Reviewed(total):</td>\n";
        print "<td><input type=\"text\" NAME=\"sys_reviewed\" size=5 maxsize=5></td> </tr>\n";
        print "<tr> <td>Systems Patched:</td>\n";
        print "<td><input type=\"text\" NAME=\"sys_patched\" size=5 maxsize=5></td></tr>\n";
        print "<tr> <td>Reasons(30 char):</td>\n";
        print "<td><input type=\"text\" NAME=\"reasons\" size=30 maxsize=30></td></tr>\n";
        print "</center>\n";
        print "</table>\n";
        print "<input type=\"submit\" value=\"Add\"> <input type=reset VALUE=\"clear form\">\n";
        print "</FORM>\n";
        print "\n</body>\n</html>\n";
} #end sub print_html


Thanks
0
Comment
Question by:tfbsr
1 Comment
 
LVL 52

Accepted Solution

by:
Julian Hansen earned 250 total points
ID: 12251672
The value for the drop down depends on the type

If it is a single select the value is stored in the parameter of the same name as the SELECT - in your case iava_id

If it is a multiple select the value is stored as a comma separated list in the variable of the same name as the SELECT

example
<SELECT NAME=iava_id MULTIPLE>

iava_id=one,two,three

HTH
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
VB6 Compile Compatibility Issue 4 87
oracle query help 18 99
PHP question(s) about order of output 9 57
move one pixel 4 58
This article will show, step by step, how to integrate R code into a R Sweave document
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now