I have a text field with an integer as the value. If the user enters an integer lower than that value I would like to trigger an alert.

So if the current value is 5, and the user enters 4, I need an alert. This alert MUST trigger BEFORE the submit button is pressed! It would be ideal if it could trigger as the value is entered.