Umbraco-Validation-Attributes icon indicating copy to clipboard operation
Umbraco-Validation-Attributes copied to clipboard

UmbracoCompare does not work

Open J35P1N opened this issue 10 years ago • 0 comments

Currently the UmbracoCompare tag does not appear to work. My fields are as follows:

    [UmbracoEmail(ErrorMessageDictionaryKey = "Enquiry.Error.Email")]
    [UmbracoRequired("Enquiry.Error.Required")]
    [UmbracoDisplayName("Enquiry.Email")]
    public string Email_address { get; set; }

    [UmbracoRequired("Enquiry.Error.Required")]
    [UmbracoCompare(errorMessageDictionaryKey: "Enquiry.Error.EmailConfirm", otherProperty: "Email_address")]
    [UmbracoDisplayName("Enquiry.EmailConfirm")]
    public string Confirm_Email { get; set; }

I have even tried doing this by just passing in the strings "Enquiry.Error.EmailConfirm" and "Email_address" but again this does not seem to work.

When I submit with the value "[email protected]" in the Email_address field and "[email protected]" in the Confirm_Email field, the model is not correctly invalidated and the remainder of my code is executed. I have also found that so far, none of the tags I have tried seem to work with JQuery Validate Unobtrusive.

J35P1N avatar Jul 18 '14 15:07 J35P1N