Why my form conditions doesn't work as expected?