Hi,
I am trying to implement wizard for my application. I am doing it with
hidden divs.
For navigation purposes: I am using hidden input fields such as:
So that when someone presses next, i can increment the current_state to
2 in JavaScript Function that i have written.
$(‘wizard_previous_state’).value = previous =
$(‘wizard_current_state’).value
current = $(‘wizard_current_state’).value = previous + 1
But "previous + 1 " is evaluated as 1 + 1 = 11 (string concat).
How do i say that i want hidden value to be integer?
Any suggestions?
Regards,
Sandeep G
On 1/27/08, Sandeep G. [email protected] wrote:
So that when someone presses next, i can increment the current_state to
2 in JavaScript Function that i have written.
$(‘wizard_previous_state’).value = previous =
$(‘wizard_current_state’).value
current = $(‘wizard_current_state’).value = previous + 1
But "previous + 1 " is evaluated as 1 + 1 = 11 (string concat).
How do i say that i want hidden value to be integer?
I’m pretty sure that the values of fields are always strings. But you
should be able to do what you want with something like
current = $(wizard_current_state).value = +previous + 1
In Javascript, using a unary + operator on a string containing a
number will produce the number.
–
Rick DeNatale
My blog on Ruby
http://talklikeaduck.denhaven2.com/