dadames
Nov 8th, 2000, 10:03 AM
My page has a form with some text controls and 2 submit buttons, the first one labeled Continue. The page submits to itself with each submit displaying new choices. For one such choice there is a text control, txtRemote, that has an onBlur event that calls a validation that resets its value to zero if the user enters more than 40000.
Here is a sequence that works correctly:
-user inputs 50000
-user clicks the Continue button (a submit)
-validation routine for txtRemote displays an alert and resets the 50000 to zero
-user clicks Ok or presses Enter to clear the alert
-the page is not submitted allowing the user to enter a new value in txtRemote
Here is a sequence that is incorrect:
-user inputs 50000
-user presses Enter key
-validation routine for txtRemote displays an alert and resets the 50000 to zero
-user clicks Ok or presses Enter to clear the alert
-the page submits to itself displaying new choices
Why does the Enter key, which normally behaves like a click on the Continue (submit) button, correctly call the validation routine but then incorrectly submit the page whereas the click on the Continue (submit) button works as expected?
Here is a sequence that works correctly:
-user inputs 50000
-user clicks the Continue button (a submit)
-validation routine for txtRemote displays an alert and resets the 50000 to zero
-user clicks Ok or presses Enter to clear the alert
-the page is not submitted allowing the user to enter a new value in txtRemote
Here is a sequence that is incorrect:
-user inputs 50000
-user presses Enter key
-validation routine for txtRemote displays an alert and resets the 50000 to zero
-user clicks Ok or presses Enter to clear the alert
-the page submits to itself displaying new choices
Why does the Enter key, which normally behaves like a click on the Continue (submit) button, correctly call the validation routine but then incorrectly submit the page whereas the click on the Continue (submit) button works as expected?