I usually also use the alert method if something is wrong with what is entered in a form field.
With your alert, it shows up the alert when I press enter no matter what I have selected, if the field is empty.