This is different than the one that it just got marked as a duplicate of because I'm not wondering about how to validate a date. I got that part figured out. I want to know how to get HTML to render correctly on the page. Like my question says.
I'm writing a custom validation because the Range attribute doesn't seem to work with dates in mvc annotations.
So I've written the validations and everything seems to work, but I can't get it to render HTML when the error message is displayed.
this.ErrorMessage = string.Format(@"To verify item prior to {0}, please visit the [an anchor tag] for further details.", minimumDate);
The anchor tag then is of course printing out raw html and not rendering it as an anchor tag.
If I put this same exact message in the Required annotation constructor it actually renders the html on the page and looks like I want it to so I know it's possible. Is there anything that I'm missing?
Thanks.
EDIT
The way I fixed this for now:
$(document).ready(function () {
$(".field-validation-error").html($(".field-validation-error").text());
});
I'm not crazy about it, but it seems to be the only way I can do it right now. I'm still open to any new suggestions once this gets the duplicate tag removed.