Your code does work, but only once - to have it continuously update, you first wrap the JS in an event-handler function and attach it to your input elements:
function mutuallyExclusive( e ) { ... }
$( '#bqOrderId' ).on( 'change keyup', mutuallyExclusive );
$( '#atgOrderId' ).on( 'change keyup', mutuallyExclusive );
See this JSFiddle.
I attached it to both the change
and keyup
events: change
to handle programatic (scripted) changes, and keyup
to "instantly" update the fields' statuses - otherwise it waits till the user removes focus from the input to call the change
event.