validating the formelements when sent