aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes Adding two variables in java script. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Adding two variables in java script." Watch "Adding two variables in java script." New topic
Author

Adding two variables in java script.

Srinivasa Raghavan
Ranch Hand

Joined: Sep 28, 2004
Posts: 1228
When I try to add two values from a hidden variables, it gets concatinated.
Can any one tell me how can i add it ?


[ December 23, 2005: Message edited by: Srinivasa Raghavan ]

Thanks & regards, Srini
MCP, SCJP-1.4, NCFM (Financial Markets), Oracle 9i - SQL ( 1Z0-007 ), ITIL Certified
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
They are strings, so you need to parseFloat() or parseInt() to convert them before adding.

Eric
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Adding two variables in java script.