My form condition is not working as expected