allow element value validation with function