How to remove validation rules which are added using validator ?

I need to remove the validation rules for a particular case, how i can do that?

I need to achieve something like this =>

let validator = formElement.ej2_instances[0];
if (editorHeading !== "Edit Event") {
validator.addRules("to", {
required: true,
range: [
this.isValidDateRange,
"Select a valid date range",
],
});
}
else{
//Remove this validation rule from "to".
}

2 Replies 1 reply marked as answer

LA Louie Al-Faraje June 6, 2022 10:29 AM UTC

Hi , i was trying stuff out, and this validator.removeRules("to") seems to work out. 

I am not deleting the thread hoping it could be useful to someone else.


Thanks, the issue is resolved, @Syncfusion team you guys can ignore this thread.


Marked as answer

SK Satheesh Kumar Balasubramanian Syncfusion Team June 7, 2022 11:28 AM UTC

Hi Louie,

Thanks for the update and we are happy that you have found the solution.

Please get back to us if you need any other assistance.

Regards,
Satheesh Kumar B

Loader.
Up arrow icon