Location.reload() not working

Saquib Mohammed
Mega Guru

Hi

i have multi layers of choice questions and I want to clear up the entire form when the top level choice value changes. 
so I have created a catalog client script onChange on the variable that is present at the top level and added the location.reload() function in the script (nothing else). However, even after choice value change for that variable, the form does not reload. 
what might be the issue?

 

5 REPLIES 5

Murthy Ch
Giga Sage

Hi @Saquib Mohammed 

Why do you want to reload the form when you have a option to clear the values?

Use below code:

g_form.clearValue("field_name");
Thanks,
Murthy

Hi Murthy

i don’t have to clear the values. I have to hide all questions that might be showing up on the form at that point when the choice value of the top level choice field changes. So I was thinking of using the reload method. 

Hi @Saquib Mohammed ,

Why don't you try 

g_form.setVisible('fieldname',false);
for hiding the questions.
Best,
Rampriya S

Bert_c1
Kilo Patron

I suggest that you post your script for the Catalog client script. I see OOB examples that hide form fields with

 

g_form.setDisplay('<field_name>', false);

 

no form reload is needed it seems. Where is " location.reload()" documented/used?