Hello.
I dare write to Perlmonks (frightening ...)
I want to "cascade" CGI forms but I can't keep the
variable $index (see the example/excerpt below). How come.
Is there any trick ?
Real use : the first submit yields an array. I use this array as a selection list for
the 2nd submit. The 2nd submit yields... nothing !
... my $q=new CGI; my ($index); print $q->header; print $q->start_html(-title=>"Modif", -author=>"cmic" ); print $q->start_form; print $q->submit(-name=>"submit1", -label=>"submit1") ; # if ($q->param('submit1') eq 'submit1') { $index="Some val"; print "DEBUG after 1st submit " . $index . "<br>"; print $q->submit(-name=>"submit2", -label=>"submit2") . " ", } elsif ($q->param('submit2') eq 'submit2') { print "DEBUG after 2nd submit " . $index . "<br>" ; } print $q->end_form; print $q->end_html; ...
-- cmic. Life helps. Perl Too.

In reply to Cascading CGI forms by cmic

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



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.