Results 1 to 3 of 3

Thread: Passing Variable

  1. #1
    Join Date
    Jun 2010
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Passing Variable

    Code:
    http://enviroflexsurfaces.com/wp-content/themes/ecobiz/sample.png
    I have created a dynamic table (see attached).
    I have set the name of each column to an array.
    The last column called "TOT" is what I need to work with:
    <td><input type="text" name="TOT[]" size="3" maxlength="6"></td>

    When you click the "AA" hyperlink, I need the Sub Total input textbox to be set with the total of all values in the TOT array. Right now I can't even get it to display anything at all, much less total.

    Here is my javascript:
    <script type="text/javascript">
    function CalculateSubTotal(TOT)
    {
    for(var i=0;i<TOT.length;i++)
    {
    alert(TOT[i]);
    }
    }
    </script>

    Here is the href where I call this function:
    <a href="javascript:CalculateSubTotal(TOT);">AA</a>



    Thanks.
    Last edited by kathycam; 06-13-2012 at 11:39 PM. Reason: fogot to add image

  2. #2
    Join Date
    Apr 2012
    Location
    Chester, Cheshire
    Posts
    329
    Thanks
    7
    Thanked 35 Times in 35 Posts

    Default

    Can you please provide us with the mark up for the page, a link to the page live online, or an attachment of a file containing the source code.

    If placing code within your post, can you please use the [HTML][/HTML] or [PHP][/PHP] tags provided in the editor to wrap your code in. This will preserve any indentation and add syntax highlighting to your code in the post.

  3. #3
    Join Date
    Jun 2010
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

Bookmarks

Posting Permissions

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