that depends a little bit on the used browsers. if the support HTML5 form, you could simply add the required attribute, otherwise you would need to write a JavaScript that checks before submitting that the text field is properly filled (and if not cancels the submit).
Comment