Hello monks, I need your expertise to help resolve this problem. I am building an online shopping cart. After the user has selected many items. i am building a table with all the items in his virtual cart(i have added all the cart items to the cookie). Now i want to give the user an option to delete items. I have a template page and my perl script to pass values to the template page. I could get the values to be deleted from the table but not able to update the cookie with the deleted items.I have tried to use <script> tag inside another javascript but it didnt work.
<script type="text/javascript"> function removeRow(src) { var oRow = src.parentNode.parentNode; document.getElementById("cart").deleteRow(oRow.rowInde +x); var title = oRow.cells[0].innerHTML; document.write("<scr"+"ipt language='javascript' src=' +http://localhost/sellaphone/temp.pl?title'></sc"+"ript>"); } </script>
Below is part of my perl script:
if ($title) { push @{$cart}, {TITLE=>$title,ANS1=>$a +ns1,ANS2=>$ans2,ANS3=>$ans3,ANS4=>$temp}; $session->param("CART",$cart); } my $template = HTML::Template->new(filename => +'checkouttemp.html'); $template->param(ROWS=>$cart); print $template->output(); }
Any help is really appreciated. Thank you Akhila.

In reply to Javascript to edit cookie set by perl by mailmeakhila

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.