Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

You don't have to have values for options. On form submit the value for the element is the string value between the opening and closing option tags. So that's not it.

If you take the action out and leave everything else intact, you can see the GET values in the URL bar in your browser:

<form name="frmStatusFilter" method="GET"> Choose Filter:<select name="StatusFilterSelect" onChange="frmStatusFil +ter.submit()"> <option>Show with status</option> <option>Show all</option> </select> </form>
When I do that, I see the value set. That means your CGI code had something wrong. I created a file called mycgi.pl and put it in the same directory as the HTML file, resulting in this for the form definition:
<form name="frmStatusFilter" method="GET" action="mycgi.pl">

You would, of course, leave yours as the same, since you have a specific CGI URL already defined.

Then I worked on the contents of mycgi.pl and added some missing CGI method calls:

my $q = new CGI; my $status = $q->param('StatusFilterSelect'); print $q->header(), $q->start_html('Status Report'), $q->h1('Status Report'), $q->p("status is $status"), $q->end_html();

You left off the header, which is very important to tell the browser that what's coming back is an HTML page. You also want the start_html to emit the html, head, and body tags. The h1 is purely optional, the p is for your data, and the end_html closes off the body and html tags to make everything neat, tidy, and validateable.


In reply to Re^2: How to extract a form data in cgi perl by Sinistral
in thread How to extract a form data in cgi perl by ghosh123

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (6)
As of 2024-04-24 12:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found