Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Why can I add value of two variable?

Status
Not open for further replies.

kukix

Programmer
Joined
May 23, 2006
Messages
3
Location
PL
Hello...
I have small problem..

I dont know how to add value of two variables.
Code:
<INPUT type=hidden value=3 name=poleForma1 id=poleForma1>
<INPUT type=button value=GO onClick="JavaScript: calculateValue(document.getElementById('poleForma1').value )">

and that function:
Code:
function calculateValue(valueee) { 
document.getElementById('poleForma1').value = eval(valueee+1); 
}

When value of input poleForma1 is 3, than function calculateValue return 31, but not 4...
What do I do bad...?

Please help me...
 
Code:
function calculateValue(valueee) {
document.getElementById('poleForma1').value = [!]parseInt(valueee, 10)[/!] + 1;
}

and here's some info:


-kaht

[small]How spicy would you like your chang sauce? Oh man... I have no idea what's goin' on right now...[/small]
[banghead]
 
thanks for help...

P.S. I'am from Poland in Europe... and i coudn't find answer on my question... thx...
 
Glad I could help - welcome to tek-tips

-kaht

[small]How spicy would you like your chang sauce? Oh man... I have no idea what's goin' on right now...[/small]
[banghead]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top