Forums

Reset filed if hidden

taro8 08 Sep, 2015
I would like to reset a field (radio button, text area and a checkbox) if they are hidden.

I set up my form so if a certain checkbox is checked then a radio button shows up along with another checkbox, of certain option in the radio button is selected then 3 text areas show up. I want to make it so if they are hidden again any values and text are removed/reset.

This is just to make things more elegant.
enzo.orsi 10 Oct, 2015
I am sorry, anyone found a solution for this problem?

I have a radio button that is showing one of two different text fields based on the selection of the radio button.
The problem is that if the user try to show one text field (and filling with some values) and then switching to the other text field, the previous text field remain valorized...

Any idea how to reset values of hidden fields?

Thank you!
enzo.orsi 28 Oct, 2015
Should I use a JS? Any other way?
I was thinking a code like:

  if ( document.getElementById('FIELD_NAME').disabled == true ){
document.getElementById('FIELD_NAME').value = '' }


But I have to do for several and several forms...
And I don't know why it is not working...
Any other way?

Thank you!
This topic is locked and no more replies can be posted.