My form condition logic is not working correctly