I suspect nothing is happening because your Perl script isn't getting called when you attempt this with jQuery. Your jQuery to deal with the submit actually isn't doing what you think it is. You need to explicity stop it from continuing as a normal form submission using preventDefault(). A full example can be found in the documentation for the post method http://api.jquery.com/jQuery.post/.

If you're using Firebug you can aid basic debugging by writing things out to the console via console.log('Something went wrong here/meaningful error message');, and making logging/errors persistant. I suspect you're just reloading the form. Further you may be interested in Using Perl, jQuery, and JSON for Web development from the tutorials section.

Update: this advice is spot on regards the printing of headers.


In reply to Re: Post from jQuery to Perl - can't access parameters by marto
in thread Post from jQuery to Perl - can't access parameters by stuckdev

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.