OnChange Client Script to Clear Form when "Select tool" value is changed Not Working

Connie5
Kilo Contributor

For some reason the form does not clear the values when I move from one value to another value under "Select Tools" - it only works when i clear that value.

For example, if i go to choice 1 to choice 2 - some of my UI policies do not work and then the values do not clear.

If i click x and clear the "select tools" field - then select choice 1 -- it works. 

Has anyone had this type of issue before?

find_real_file.png

 

15 REPLIES 15

Connie5
Kilo Contributor

I would click a tool and then clear the variable and this container will still appear and stay there.

It should only appear when DNA-Tableau is selected

find_real_file.png

UI Policy: When a tool is selected, show the fields you need to see. Make sure 'Reverse if False' is selected as it will reverse the logic automatically without you having to write another policy to handle the opposite logic.

 

If you 'include none' in your dropdown, that's a good indicator to say, when 'none' is selected, do not show those variables. When you're "clearing the dropdown", make sure to just set it back to the option 'none'.

So, if 'DNA-Tableau' is selected, that would be your UI Policy's condition. When that's true, make the other variables visible and check the 'Reverse if false' checkbox to reverse this logic and hide the variables when it's not selected.

Hope this answers your question.

Connie5
Kilo Contributor

It doesn't seem to clear the form even with my OnChange script

I cleared the "select tool" and then re-selected Microstrategy and it still appeared with the role filled out.

 

As I stated in my previous reply about your onChange script, you need to remove the unnecessary "or" next to the newValue

If you are trying to hide a field based off another field's value, I would again advise that you create a UI policy to achieve this instead. Please mark my answer correct as it answers your question, although you have not made the advised changes.

SaiRaviKiran Ak
Giga Guru

Hi,

 

You can try replacing line 2 with " if (isLoading) {".