Solved

Drop down menu value

Posted on 2004-10-07
1
164 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 51

Accepted Solution

by:
Julian Hansen earned 250 total points
Comment Utility
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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
copyEndy  challenge 15 55
countAbc challenge 9 49
mapAB Challlenge 35 84
Not needed 13 53
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
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 …

772 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

11 Experts available now in Live!

Get 1:1 Help Now