I just started working with CGI::Application and have run into a weird little snag. I have created a simple Module which has three run-modes. The first shows data from a database, the second shows an edit page and the third handles the submition of the second mode. This third mode does a redirect to the 1st page on succes and to the 2nd on failure (when the database returns an error, this is done with stored procedures).

All works fine, but sometimes (for no appearent reason) the third mode is called twice after submitting the form (when only clicking the submit button once, yes I checked this). This became clear when I was getting errors from the database stating that data had already been deleted.

The scripts itself are fairly simple and no special things are done. I have tested with the same data over and over again and there 'seems' to be no pattern whatsoever. I am not even entirely sure that this is an CGI::Application problem, but I am a bit in the dark on this one since it seems to happen randomly.

Now I am just wondering if anyone has run into this problem and where I should continue looking...

Update: seems to happen only when running the cgi from explorer.

Update 2: -Hitting head on Table- Problem solved => I forgot a "return false;" in my calling the javascript submit function, and I kept reading over it! -Still hitting head on Table-

In reply to CGI::Application submitting twice by aukjan

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.