Hi.... The first bit of code is the form that the user enters the information.
sub get_product_table { my $sth = shift; my @row; while (my $ref = $sth->fetchrow_hashref ()) { # generate a form allowing a quantity of the item to be added # to the cart push (@row, start_form(-method=>'GET', -action=>url()), hidden( -name => "choice", -override => 1, -default => "add" ), hidden( -name => "item_id", -override => 1, -default => escapeHTML( $ref->{item_id} )), Tr ( td ( escapeHTML( $ref->{item_id} )), td ( escapeHTML( $ref->{description} )), td ( { -align => "right" }, escapeHTML( sprintf( "%.2f", $ref->{pri +ce}))), td ( "" ), td ( textfield( -name => "quantity", -size => "2")), td (image_button( -name => "Add Item", -src=>"../images/add.jpg", - +border=>"0" ))), end_form() ); } $sth->finish (); return undef unless @row; # no items? unshift (@row, Tr ( # put header row at beginning th ("Item"), th ("Description"), th ("P +rice"), th ("" +), th ("Q +ty"), )); return (table ({-border => 0, -align => "center"}, @row)); }
The next bit of code is the next form that reads the inputted data and allows the user to make changes.
push (@row, start_form(-method=>'GET', -action=>url()), hidden( -name => "choice", -override => 1, -default => "update" ), hidden( -name => "item_id", -override => 1, -default => escapeHTML( $i +tem_id )), Tr ( td ( escapeHTML( $item_id )), td ( textfield( -name => "quantity", -s +ize => "2")), td (escapeHTML ($item_ref->{description})), td ({-align => "right"}, escapeHTML (sprintf ("%.2f", $item_ref->{price +}))), td ({-align => "right"}, escapeHTML (sprintf ("%.2f", $total_item_price +))), + ($show_links ? td (a ({-href => $url}, img ({-src => "../im +ages/delete.jpg", -border => "0"}))) + : td (" ")), end_form()
If you need more info, let me know. Thanks.

In reply to Re: Re: Passing Data by b310
in thread Passing Data by b310

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.