Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    May 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Help sending data from javascript to form

    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.

  • #2
    Regular Coder
    Join Date
    Apr 2012
    Posts
    165
    Thanks
    1
    Thanked 39 Times in 39 Posts
    Why use JS at all for this? Why not just create a "remove_item" function in your perl/cgi script?

  • #3
    New to the CF scene
    Join Date
    May 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Yeah i have done that. But is it possible to send data or share data between javascript to perl script ?

  • #4
    New Coder
    Join Date
    Mar 2012
    Posts
    60
    Thanks
    65
    Thanked 0 Times in 0 Posts
    i have doe it before using ajax with php
    http://api.jquery.com/jQuery.ajax/


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •