event handler for the cost text field and the radio button (midway)