Added javascript validation.