Radio button to populate a text field
I have a form that has 5 different radio button options. The group name is Unauthorized Debit. Each radio button has a unique export value, i.e. button 1 is value 1, button 2 is value 2, button 3 is value 3, button 4 is value 4 and button 5 is value 5.
Each of these radio buttons has a text field in the sentence they are attached to that i want to populate ONLY if that sentences radio button is selected. I have written a script to do this, and it populates when i select an option, HOWEVER, if the user decides that they didn't want to click that radio button and they select a different one, the previous selections text field stays populated, even though a new selection has been made.
This is the script I added to each radio button. The getField changes in each, button 1 has a field that is just COMPANY NAME, the below example is for button 2, and so on for buttons 3 (COMPANY NAME_3), 4 (COMPANY NAME_4) and 5 (COMPANY NAME_5). I cannot find anything on how to make a text field CLEAR when a different radio button is selected and the previous value is now Off. Any help would be appreciated!!

