www.webdeveloper.com
Results 1 to 2 of 2

Thread: How to fix this error?

  1. #1
    Join Date
    Jun 2007
    Posts
    1

    How to fix this error?

    I encounter the some problem while adding the array elements like
    h[i]=a[i]+b[i]+c[i]

    when a[i]=1 b[i]=2 c[i]=3, it makes h[i]=123

    It treats the array elements as characters.
    I use
    <input type="text"> command to insert elements into arrays...


    Plz anyboby help.....

  2. #2
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    21,654
    input is a text value not an integer.
    Code:
    a[i]=parseInt(document.formName.elementName.value);
    At least 98% of internet users' DNA is identical to that of chimpanzees

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