Hallo Perlmonks,

I have a form with a table where new rows can be added/deleted dynamically by clicking on add/remove button. The new rows are now added at the end of the table, but in the future I must have the possibility to insert new rows in any position in the table and move up/down the rows. The table will contain Access List and the order of rules is critical.

The new rows contain more columns with input fields, checkboxes, radio buttons and a select list. The table is populated with data from a small database (and all form elements used now unique name). I used Perl and JavaScript to do this job.

My problem begin when I try to save the new added/removed rows back into the database. When I submit the form, the POST string not contain my new added data. Yes, I know what is happening but I have no solution.

My question is, how can I save my changes (with new added rows) from the HTML table into the database? I wish to use simple programming style (KISS style) and not big/complicate module. Template style and performance is not important for me, because will be one page and only one user will work with the application. The security is very important.

I wish to use only perl (and perhaps JavaScript, but no AJAX) for my work. If it's necessary, I can restart all over again in accord with your guidance.

Thanks in advance for your sugestions

Josef

In reply to Save data from a dynamic HTML table into database by josef

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.