Added validation to the stock form.