But let's say the 1st number is 50 and the 2nd is 9. The alert comes up because the "9" is bigger than the "5" in 50.
How can I make this work?
I have a hidden field that is bringing the answer from page 1 to page 2.
[HTML]
<input type="hidden" name="Q1" value="$Q1">[/HTML]
This is my if statement:
Expand|Select|Wrap|Line Numbers
- answerA = document.forms[0].Q1.value
- answerB = document.forms[0].Q2.value
- if (answerB > answerA)
- {
- alert("\"Please enter a smaller number.")
- FormQ2.Q2.focus();
- return false;
- }