added javascript validation to button