I have a FormInput widget with selection sub_id :
<rn:widget path="input/FormInput" name="Incident.CustomFields.c.customer_type"label_input="#rn:msg:CUSTOM_MSG_CUSTOMER_TYPE_LBL#" class="form-control" id="cstype" sub_id="selection" onchange="StoreSectors();"/>
And in javascript I have only this :
function StoreSectors() {
alert('Its Working');
}
but onchange it's not working this way . How can I grab the onchange event of a selection input with Javascript?
I'd add an event listener OR use jQuery in the bottom of the page after load. Usually custom fields have different id prefixes but have the custom field name ending:
Example:
$("[id$='CustomFields.c.customer_type']").change(function(){ StoreSectors(); });