You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

Custom Widget for Dynamic Field Validation

Question
18
Views
0
Comments
edited Jun 7, 2022 1:23PM in General Technical Discussions

Summary:

Need to make a text field required ONLY if a specific dropdown menu value is selected

Content (required):

Hi there,

Need to make a text field required ONLY if a specific dropdown menu value is selected.

There are 2 custom widgets involved, one for the select control (fires the rightnow event on selection), and the other for the text field that needs to be required only if the "other" option is selected (listens to the event)

The only functionality that is being executed is setting

this.data.attrs.required = true;

or

this.data.attrs.required = false;

If you inspect the element (text field) after the event, the required attribute gets properly set, however this alone is not enough to trigger the post submission required validation.

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!