Skip to main content
4 of 7
edited tags
avpaderno
  • 97.9k
  • 15
  • 164
  • 284

Webform element validation custom module

I want to add a custom validation to text input, I followed the instruction provided in https://www.drupal.org/docs/8/modules/webform/webform-cookbook/how-to-add-custom-validation-to-a-webform-element

I have a requirement which needs to verify an id entered into a text box, by making a REST API call to another system, the issue is to make that REST API call, I need another text parameter which is also inputed into the webform. I have written a custom handler which makes that rest call, but that custom handler work on webform post save option only, how can I pass more than 2 fields to the validate function mentioned in the example given.