Validating registration forms using javascript