If you disable an input, its value is not sent when you submit the form. So you could use an onSubmit
event on the form to disable the right input before the form is submitted.
With jQuery, it would look like this:
$('form').on('submit', function() {
var textInput = ...;
var dropdownInput = ...;
if (textInput.val() == '') {
textInput.prop('disabled', true);
} else {
dropdownInput .prop('disabled', true);
}
});