How can I prevent submission if certain fields are not entered?