2

In this form, i have to compare two fields(Mail,Confirm Mail). Whether this both email is same or not.if we typed incorrect email in confirm mail field. we have to show error message. so i created confirm email custom validation and assign to confirm form field.

In this confirm custom validation, i'm not able to get other form field value(mail Field). how we can get the email value (other field value) in confirm custom validation.

enter image description here

1

This is currently not possible out of the box nor is there a way to plugin an "entire form validator".

I think the best option at this time is to create a custom submit action and perform the validation in that action.

The execute method should return a boolean, if you return false, the submit pipeline will be cancelled.

protected override bool Execute(T data, FormSubmitContext formSubmitContext)
3
  • Could you please provide sample code for validation for this scenario
    – PKH
    Apr 1 '19 at 9:49
  • Is not possible solve through custom field validation?
    – PKH
    Apr 1 '19 at 10:02
  • Unfortunatly, it is not possible as the custom validation will only give access to the value of that field and not the entire form. Apr 1 '19 at 10:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.