Unable to find the way of validation for custom fields

I have customized the event editor form with my custom names and data-names, could you give any solution to validate all form fields before saving and prevent close popup.



1 Reply 1 reply marked as answer

SK Satheesh Kumar Balasubramanian Syncfusion Team February 3, 2021 04:17 PM UTC

Hi Chetan, 
  
Greetings from Syncfusion Support..! 
  
We have validated your reported query at our end and prepared sample to meet your requirement which can be viewed from the following link. 

 

Code Snippet:  
  private onPopupOpen(args: PopupOpenEventArgs): void {
    if (args.type === "Editor") {
      const formElement: HTMLElement = args.element.querySelector(
        ".e-schedule-form"
      ) as HTMLElement;
      this.validator = (formElement as EJ2Instance)
        .ej2_instances[0] as FormValidator;
      this.validator.addRules("EventType", {
        required: [true, "This field is required."]
      });
    }
  }


Kindly try the above sample and get back to us, if you need further assistance. 
 
 
  
Regards,   
Satheesh Kumar B 



Marked as answer
Loader.
Up arrow icon