Thank you for giving me some more to go on. I can understand your not wishing to share proprietary (or maybe incriminating! :) information. Please know that demonstrations of bad behavior can really pretty easily be mocked up (see below ;).

I looked at the docs for CGI (which I haven't done in a very very very long time, and I think my locally installed copy is a little rusty, hence not using things like start_table) and really can't undertand what's causing this behavior.

I whipped up something that is self contained, possibly recreates the functionality your form has (I could be way off, though), and doesn't really do anything other than to exercise the code - if you hit "New Entry", nothing happens, since the data shown in the rows is coming out of an unchangeable __DATA__ section.

#!/usr/bin/perl use CGI qw/:standard/; my $q = new CGI; %in = map { $_ => $q->param( $_ ) } $q->param; print "Content-type: text/html\n\n"; print "<table border='1' cellpadding='5'>"; print Tr( td( [ "First", "Last", "<a href='testme.cgi?action=add'>add</a>" ] ) ); while( <DATA> ){ for( [ split /\s/, $_ ] ){ print Tr( td( [ $_->[0], $_->[1], "<a href='testme.cgi?action=edit&firstname=$_->[0]" ."&lastname=$_->[1]'>edit me</a>" ] ) ); } } print "</table>"; print start_form; if( $in{action} eq 'edit' || $in{action} eq 'add'){ if ($in{'submit'} eq 'New Entry') { print table( Tr( { -valign => "TOP" }, [ td( [ "First Name", textfield( -name => 'firstname', -size => 80 ) ] ), td( [ "Last Name", textfield( -name => 'lastname', -size => 80 ) ] ) ] ) ); } else { print table( Tr( { -valign => "TOP" }, [ td( [ "First Name", textfield( -name => 'firstname', -size => 30, -value => $firstname ) ] ), td( [ "Last Name", textfield( -name => 'lastname', -size => 30, -value => $lastname ) ] ) ] ) ); }; print submit( -name=>'submit', -value=>'New Entry'); } __DATA__ Kent Cowgill J CK Fred Patterson Steve Peterson

I would be really interested if you follow these steps:

  1. Click one of the "edit me" links
  2. Click "New Entry"
  3. Click "add"

... and you see the behavior recreated (i.e. whatever was in there last during an "edit" shows up after clicking "add".

Otherwise, pvbcharon might be on to something - you're seeing persistence of data that has a source other than your code.



--chargrill
s**lil*; $*=join'',sort split q**; s;.*;grr; &&s+(.(.)).+$2$1+; $; = qq-$_-;s,.*,ahc,;$,.=chop for split q,,,reverse;print for($,,$;,$*,$/)

In reply to Re^5: how to use -nosticky in CGI? by chargrill
in thread how to use -nosticky in CGI? by jck

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.