How to set conditions in my form properly?