Quantcast
Channel: DataTables 1.10 — DataTables forums
Viewing all articles
Browse latest Browse all 2364

Update field value based on another field changed inline.

$
0
0

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( '');
} );

Viewing all articles
Browse latest Browse all 2364

Trending Articles