Solved

Drop down menu value

Posted on 2004-10-07
1
167 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 54

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

825 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