JSFiddle - React, Tailwind, and code Playground
HTML
<form action="">
<input type=text name=txt1>
<select name=cbo1>
<option></option>
<option>something</option>
<option>else</option>
</select>
<input type=submit>
</form>
JavaScript
document.forms[0].addEventListener('submit', function(event) {
if (event.target.txt1.value && ! event.target.cbo1.value) {
event.preventDefault();
alert('textbox is not empty but a combox box is')
}
}, false);