?
Solved

Drop down menu value

Posted on 2004-10-07
1
Medium Priority
?
177 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 58

Accepted Solution

by:
Julian Hansen earned 750 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Simple Linear Regression

764 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