Solved

Drop down menu value

Posted on 2004-10-07
1
174 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 57

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

What Is Transaction Monitoring and who needs it?

Synthetic Transaction Monitoring that you need for the day to day, which ensures your business website keeps running optimally, and that there is no downtime to impact your customer experience.

Question has a verified solution.

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

This is an explanation of a simple data model to help parse a JSON feed
Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Starting up a Project

687 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