...

View Full Version : Help sending data from javascript to form



mailmeakhila
05-23-2012, 05:03 PM
Hi

I am writing a shopping cart in perl/cgi. I have a page where i am trying to give a delete button to delete items from shopping cart. I have written the following code to delete from the html and send that row value to the perlscript to delete it permanently(as it can reapper if page refreshes just by deleting html). I am having trouble accessing value submitted by javascript to my cgi script.
Below is my code:
<code>
function removeRow(src) {
var oRow = src.parentNode.parentNode;
var temp = oRow.rowIndex;
document.getElementById("cart").deleteRow(temp);
alert(temp);
document.getElementById('checkout').method = "get";
document.getElementById('checkout').submit(temp) ;
}
</code>

Any help is really appreciated.

Thank you
Akhila.

EpicWebDesign
05-24-2012, 04:44 PM
Why use JS at all for this? Why not just create a "remove_item" function in your perl/cgi script?

mailmeakhila
05-24-2012, 04:51 PM
Yeah i have done that. But is it possible to send data or share data between javascript to perl script ?

code-in-time
05-24-2012, 06:06 PM
i have doe it before using ajax with php
http://api.jquery.com/jQuery.ajax/



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum