Refresh text filed when ever clicks on other radio button

I had a radio button where 

scenario: click yes need to populate a text field, clicks NO it needs to hide and the text field and refresh the field .

In this scenario there is a button layout as save and edit options as buttons. when clicks on save it is making an entry to db, when click on edit and changes to NO still the previous value is not refreshing to null but stores the previous value.

Question: need to refresh when ever clicks on NO button.

Thanks in advance

  Discussion posts and replies are publicly visible