Hello, I have a form that I need to pre-populate with the previous responses made from that form. I was going to pre-populate the HTML Form with JSON data using jquery and then pass to a CGI to save the results to a JSON file, but Chrome is now blocking external files like this, even though everything is on the same local server.

So now I am doing this with CGI to load the JSON values and output the HTML with the form data pre-populated.

So can I submit the form data to the same CGI Perl script? Or do I need to have one CGI for the HTML Form, and another CGI to process the form and save to the JSON file?

I see lots of examples of posting form data from HTML to a CGI to process, and I have done this before. I am not finding any examples of how to bring the data into the same CGI script from the outputted HTML.

I am probably missing something simple, but if the only way to do it is with 2 CGI scripts, that will work as well.

Thank you.

Original content restored above by GrandFather

PerlMonks admins, please remove. Unfortunately people here think every question is stupid, and no longer wish to help other people like they used to do. They only want to downvote questions from people trying to learn and ask for help when something is confusing, instead of trying to help them.

I will look for help elsewhere.

Thank you.


In reply to CGI HTML Form Data by johnfl68

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.