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.