Hello,
I am using JS to make fields in a table read only based on what radio button they select. When they save as a draft those values in the read only fields are lost. To bypass this, I need to disable read only when they click on the Save as a Draft button. The ID of the button is ihSaveDraft. However the JS I have below doesn't trigger on that ID. I tried using the btn-primary class as well without any luck. Even the alert doesn't trigger.
$('.ihSaveDraft').on('click',function() { alert('Test'); $('.allowEdit input').attr('readOnly', false); $('.allowEdit input').attr('disabled', false); $('.allowEdit textarea').attr('readOnly', false); $('.allowEdit textarea').attr('disabled', false); $('.allowEdit select').attr('readOnly', false); $('.allowEdit select').attr('disabled', false); });
Here is the Save as draft element
<button id="ihSaveDraft" class="btn btn-primary" ng-if="ihd.item.$rights.saveDraft && ihd.allowSaveDraftBtnForTaskReview" ng-disabled="ihd.saveDraftBtnDisabled" ng-click="ihd.saveDraft()" title="Save draft"> Save draft </button>
Is what I'm attempting to do even possible? Does the JS to run on the save to draft button need to be different than action buttons? I know this would work for an action button.
Any help or insight would be appreciated.
Stephen