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

Possible to change widget's attribute via Javascript?

Received Response
20
Views
2
Comments
edited Sep 26, 2018 9:16AM in Customer Portal 2 comments

Content

I'm in need of changing the "input/FormInput" widget's "required" attribute value dynamically via javascript based on a certain selection. Is it even possible to do so? The "Incident.CustomFields.c.abc" is used with the "input/FormInput" widget.

 

The code I'm using is as follows:

constructor: function() {        
    /* some code above this line */     
    this._radioButtons.on('click', this.onAccountTypeSelect, this); // this is the trigger
},
onAccountTypeSelect: function(evt) {
   var selectedValue = evt.target.get('value');
   if(selectedValue === 'A')
   {
      // make Incident.CustomFields.c.abc as required
   }
   else
   {
      // make Incident.CustomFields.c.abc as not required
   }
}

Version

3.7

Howdy, Stranger!

Log In

To view full details, sign in.

Register

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