Why are the radio buttons values not passed properly in the conditions?