Not all required fields are validated with when using editorTemplate, validator seems to ignore a required field

Hello,

I have a schedule component using an editorTemplate.

I wanted to do some validation.  

I was following the following documentation:

https://ej2.syncfusion.com/react/documentation/schedule/editor-template/#field-validation

In this case I wanted to require a number of fields.   Fields like, StartTime, EndTime, description, all work as expected when I set 

validation: { required: true }


But when I added a new field called specialnumber , it doesn't validate despite having the validation set the same as description.

Here is a simplified example that like my code will validate the description field, but not the specialnumber field:

https://stackblitz.com/edit/editortemplate-with-recurrenceeditorcomponent-qvn57f?file=index.js

Is there something about the specialnumber input that the validator doesn't like / requires?

Ultimately I plan to make an api call to validate 
specialnumber to validate that number, but at the moment I just need it to just be recognized by the validator as required before I go farther / decide how I want to do that.


1 Reply 1 reply marked as answer

VM Vengatesh Maniraj Syncfusion Team November 3, 2021 11:25 AM UTC

Hi Mark, 

Greetings from Syncfusion Support. 

We have validated your query “Is there something about the specialnumber input that the validator doesn't like / requires?” at our end and we have to let you know that if we want to add the validation for our additional fields, it needs to be added the validation rule for the additional fields. For more reference, please visit the below UG documentation. 
 
 
Also, we have prepared the sample with the same scenario. In that sample, we have used the popupOpen event to add the validation rule for additional fields. 
 
  onPopupOpen(args) { 
    if (args.type === 'Editor') { 
      let statusElement = args.element.querySelector('#specialnumber'); 
      statusElement.setAttribute('name''SpecialNumber'); 
      let formElement = args.element.querySelector('.e-schedule-form'); 
      let validator = formElement.ej2_instances[0]; 
      validator.addRules('SpecialNumber', { required: true }); 
    } 
  } 
 
 
Kindly try the above sample and get back to us if you need any further assistance. 
 
Regards, 
Vengatesh 


Marked as answer
Loader.
Up arrow icon