Con html5 basta mettere required nel input.