I need to reset fields values based on a value changed in another inline field . I tried using the following script, however when the table is loaded the first time, the code is executed and wipes out the values in said fields. I just need to perform this operation when a user changes the HRWPER. So let's say, if the percent field changed from 2.0 to 3.0, I need to reset other fields.
I am sure there is a better way to do this so all suggestions are welcomed.
$( editor.field( 'HRWPER' ).input() ).on( 'change', function () {
//**Reset Plant Manager Approval function
editor.field( 'HRWMGR' ).val( 0);
editor.field( 'HRWMNA' ).val( '');
} );