Why conditions are not working in my form?