js method to prevent default on empty string submission

bug fixed! JS, it does stuff!!!