prepare javascript validation