I have an inventory application using Mason. This particular form is for entering purchase orders. Our purchase orders consist of a generic block of details (date, vendor, buyer) and any number of line items.

Using an input for "How many line items does this PO have" I am able to generate a form that produces a table of line items exactly the length required. Example:

<tr> <th>description</th> <th>partno</th> <th>qty</th> <th>price</th> <th>currency</th> </tr> <tr> <td><input type=text name="description1"></td> <td><input type=text name="partno1"></td> <td><input type=text name="qty1"></td> <td><input type=text name="price1"></td> <td><input type=text name="currency1"></td> <input type=hidden name="podid1"></td> </tr> <tr> <td><input type=text name="description2"></td> <td><input type=text name="partno2"></td> <td><input type=text name="qty2"></td> <td><input type=text name="price2"></td> <td><input type=text name="currency2"></td> <input type=hidden name="podid2"></td> </tr>

What is the best way to pass all these variables to a mason component that does all the SQL work? How do I declair the variables qty1, qty2...etc in an <%args> if the number if them is always different?

Neil Watson
watson-wilson.ca


In reply to HTML forms and variable line items by neilwatson

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.