This week's book giveaway is in the Big Data forum.
We're giving away four copies of Elasticsearch in Action and have Radu Gheorghe & Matthew Lee Hinman on-line!
See this thread for details.
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 Elasticsearch in Action this week in the Big Data 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

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

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

rocket mass heater kickstarter
subject: Adding two variables in java script.