jsp- how to assign input value into another variable I would like to use later?
the problem is
when I say:
alert(parseInt(document.frmFuture.txtDays.value) + 7);
(value is number that user input) it shows fine.
but when I say:
var tmp = document.frmFuture.txtDays.value; alert(tmp + 7);
it gives me undefined.
Actually, I want to do some cals later using the input number. But it looks like impossible? how can i do that?
You forgot the parseInt.
var tmp = parseInt(document.frmFuture.txtDays.value); alert(tmp + 7);
Now it should work.