Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

Client Script: Reload page based on field conditions

Desmo
Mega Guru

Hello community,

 

I attempting to create a client script that reloads a form onChange. When the State field changes to a specific value (e.g. 7), reload the page. However, the script reloads for every state. Also, I attempted to add condition where Category is a specific value (e.g. Application)--it did not work.

 

Assistance is appreciated.

 

function onChange(control, oldValue, newValue, isLoading, isTemplate) {
    if (isLoading) {
        return;
    }

    if ((newValue == '7' ));
	
        location.reload();

}

 

Regards.

1 ACCEPTED SOLUTION

Samaksh Wani
Giga Sage

Hello @Desmo 

 

Plz Correct your Script with mentioned below:-

 

 

 

function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}

if(newValue == '7'){
 location.reload();
}

}

 

 

 

Plz Mark my Solution as Accept and Give me thumbs up, if you find it Helpful.

 

Regards,

Samaksh

 

View solution in original post

1 REPLY 1

Samaksh Wani
Giga Sage

Hello @Desmo 

 

Plz Correct your Script with mentioned below:-

 

 

 

function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}

if(newValue == '7'){
 location.reload();
}

}

 

 

 

Plz Mark my Solution as Accept and Give me thumbs up, if you find it Helpful.

 

Regards,

Samaksh