How to clear a previously selected dropdown option when a field is hidden?

  • Profile Image
    AgilityAssoc.Canada
    Asked on August 28, 2017 at 11:39 AM

    HI,

    On my form 52745887899988 I have drop down lists for province club names. A list is selected by radio button for a province which by conditions only displays drop_down for chosen province. I then move the selected club value from that province to a field called Host Club witch I used for submission. I notice that if I select a club from let's say BC then switch to AB, the BC selection is still there if I go back. Should I be concerned that I might not get the right value in Host Club ? Should the other drop_down lists be reset to blank?

     Many thanks Robert

  • Profile Image
    Marvih
    Answered on August 28, 2017 at 12:37 PM

    Hi Robert,

    Upon checking I think that is all okay. since values are updated every time you change the selection. No need to reset the dropdown list.

     

     

  • Profile Image
    BJoanna
    Answered on August 28, 2017 at 12:59 PM

    I also tested the form and I was able to replicate mentioned issue.

    The previously selected option is still shown because the AB dropdown field is still filled. It should not reset because it was selected and because the hidden field settings is set Don't Clear.

    You can set this option to Clear On Being Hidden if you want to reset the dropdown fields. 

    However, in this case, the data will not be passed (it will be cleared) to the Host Club field because the field is hidden on your form. 

    As possible workaround, you can set the Host Club field to be shown on the form and hide it with the CSS.

    You can hide it with this CSS code:

    li#id_11 {

        display: none;

    }

    How to Inject Custom CSS Codes

    Hope this will help. Let us know if you need further assistance.

  • Profile Image
    AgilityAssoc.Canada
    Answered on August 28, 2017 at 01:42 PM

    Hi,

    OK I have it Clear On Being Hidden and it appears to be working as I want.

    Thank you, both of you.

    Robert