How difficult would it be to not allow the person to press submit and continue until they have put a value higher than 25? At the moment it does give that pop-up warning, but they can still press submit and go ahead...
Your submit button: <input type="submit" name="submitName" disabled="disabled" />
To andreas' comment above - absolutely you must validate from the server if it is that critical that the data be correct.
I use client side validation only for "oops" catching - not enough digits in a phone number or zip, bad date format, etc.
Serious validation - duplicate keys, totally bogus entries, have to be validated on the server. For the oops entries, it's not mission critical that the data be correct, the user would be upset later if the phone number he entered showed up as 6 digits, but that's his problem.