add an OnClick="function_name();"
in the html of your submit button,
and in the declaration of the function do this
function function_name(){
var str = document.getElement("your_text_field_id");
if (str=="") {
alert("Please type some text first");
return false
} else {
alert("Thanks"); //optional
return true;
}
}