javascript * value

kaits

Mitglied
Hi!

How can I multiply?

\' + (parseInt(document.getElementById(\'p_arv_'.(int)$r[0].'\').value) * '.$r[4].')

this all is inside a PHP echo sentense, but there is something wrong with javascript :(!

feel free to answer in German!

thanks!
 
Did you quote the singleslashes? Or is it a forumbug?
' + (parseInt(document.getElementById(\\'p_arv_'.(int)$r[0].'\\').value) * '.$r[4].')
If you do, I think you must use parseInt first to the value and then do your multiplication. Cause normaly a value of a textfield is type of string. A string can't be calculated with a number...
Code:
' + (parseInt(document.getElementById(\\'p_arv_'.(int)$r[0].'\\').value)) * '.$r[4].'
Gruss
Jan
 

Neue Beiträge

Zurück