Possible to change widget's attribute via Javascript?
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.70