Click here to Skip to main content
15,899,313 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have two MVC edit forms where range validation works perfectly, highlighting as soon as you click away from a text box containing an out-of-range value.

But I have a third edit form where, for some reason, range validation is only working when I click the submit button, but not when I just click elsewhere away from the out-of-range text box. Any idea what might cause that?

I have the Ranges, like [Range(0, 4)] specified in a supplemental partial class to avoid the auto-generation. I have the range text included in the edit view form, like:

@Html.ValidationMessageFor(model => model.G, "0 (Lowest) to 4 (Highest)", new { @class = "text-danger" })

What I have tried:

Not sure at this point what to try. The faulty edit view appears to be set up the same as the good ones.
Posted
Updated 22-Dec-16 9:30am
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900