I'm working with perl::cgi and I'm having a couple issues.
I'm trying to use a hidden param lets call it "current" to control the flow on my page. When I insert this parameter with a different value in different cgi forms it defaults to it first assigned value in the html generated.
Example:
push(@buffer, $cgi->start_form(-method => 'post' , -action => 'example
+.cgi'),
$cgi->submit(-name => 'edit_notes', -value=>$timestamp, -la
+bel =>"edit"),
$cgi->hidden(-name => 'user', $user),
$cgi->hidden(-name => 'current', -value=>'example'),
$cgi->end_form);
When I create another form later on in the page and have an alternate value for 'current' it is replaced in the html by 'example'.
The other issue I am confused about which may or may not be related is that in the html generated by the cgi forms it is including multiple copies of the same parameters.
The above code generates this:
<input type="hidden" name="user" value="UserID" UserID />
<input type="hidden" name="user" value="UserID" UserID />
<input type="hidden" name="user" value="UserID" UserID />
<input type="hidden" name="user" value="UserID" UserID />
Any help would be appreciated.
In reply to cgi issues
by jared
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.