added form validation to purchase pages