var ContentEditingHelper;$(ContentEditingHelper = function () {    var costCenterSelector = '#CostCenter';    var projectSubcodeSelector = '#ProjectSubcode';    var incidentNumberSelector = '#IncidentNumber';    //This bit of code affects the 'Add New Order' dialog. It works on the 'Incident Number', 'Project Subcode', and 'Cost Center' input fields.    //Since only one of these fields is allowed to be populated at a time -- use jQuery to disable the other fields when typing is detected in one.    $(this).on('keyup', '#CostCenter, #ProjectSubcode, #IncidentNumber', function () {        if ($(this).val() === '') {            $(costCenterSelector).prop('disabled', false);            $(projectSubcodeSelector).prop('disabled', false);            $(incidentNumberSelector).prop('disabled', false);        }        else {            switch (this.id) {                case 'CostCenter':                    $(projectSubcodeSelector).prop('disabled', true);                    $(incidentNumberSelector).prop('disabled', true);                    break;                case 'ProjectSubcode':                    $(costCenterSelector).prop('disabled', true);                    $(incidentNumberSelector).prop('disabled', true);                    break;                case 'IncidentNumber':                    $(costCenterSelector).prop('disabled', true);                    $(projectSubcodeSelector).prop('disabled', true);                    break;            }        }    });    //Public methods go here.    return {    };} ());So I've got this and it works. There are some clear code smells and some not-so-clear. I would like to be able to be able to reuse my selector names as much as possible. Is it possible to use them in my declaration of on? And how should I handle my case statements?Furthermore, is there an overall easier way to achieve my goal?
I have three input fields. When one has any information in it, the others should be disabled. Can I express this more succinctly?
javascript;jquery
var $inputs = $('#CostCenter, #ProjectSubcode, #IncidentNumber');$inputs.on('keyup', function() {    $inputs.not(this).prop('disabled', this.value !== '');});If your elements are not available at document ready, use this:var selector = '#CostCenter, #ProjectSubcode, #IncidentNumber';$(document).on('keyup', selector, function() {    $(selector).not(this).prop('disabled', this.value !== '');});Just keep in mind that this will query the DOM on every single keyup!! Are you sure you can't somehow do this differently?