dcsimg
www.webdeveloper.com
Results 1 to 2 of 2

Thread: Simple adding values Issue

  1. #1
    Join Date
    Mar 2004
    Location
    Sydney Australia
    Posts
    51

    Simple adding values Issue

    Hi JS people

    Why can I not do this:

    document.getElementById("bt" + j).value = Number(document.getElementById("bt" + j).value) + Number(document.getElementById("bt" + j + i).value); //Horiz Totals

    Its simply adding the value of one text box to another. The form field names are dynamic usinf ASP that why I have said:

    "bt" + i and "bt" + j

    The i and j are variables which are counters be incremented inside a for loop

    TYIA

  2. #2
    Join Date
    Dec 2003
    Location
    Bucharest, ROMANIA
    Posts
    15,428
    Is it name or id the token you are looking for? If you are using getElementById(id), make sure the element has an id, not a name. name and id are different animals.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles