I implemented the DateTime dropdown and validation based on the accepted answer in the following section:
How to validate the date using 3 drop-down lists (day, month, year) using unobtrusive jquery validation?
I am using MVC 4.
This date with three drop-down lists works fine basically, but sometimes when I click on these three drop-down lists and select different values (including “unselected” values), I get a default error message form. Validation DateTime. Field. Date of birth should be Date. "Even if I chose a valid year / month / date and my custom validator passes.
This message does not prevent POSTing forms when the date is set correctly, but the message is confusing for users.
When I check the unobtrusive rules in Firebug, I see that this message comes by default by default. I know that I can use the rules (“delete” (or delete the rule, message) to delete this default date rule, but I'm not sure when it is time to delete them to stop adding this MVC rule again.
How to remove this default “date” rule to ensure that only my custom rule is valid for these three drop-down lists?
source
share