We're reclaiming inactive PDIs to keep them available for active builders. Learn what's changing, who's affected, and how to protect your work. Read More

Reload page by onchange client script

Rosy14
Kilo Sage

below code not working.

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

    //Type appropriate comment here, and begin script below
    if (newValue == 1)
        location.reload();
}
15 REPLIES 15

SanketLandge1
Kilo Guru

Hello @Rosy14 ,

 

Can you please explain the requirement?

 

Is your backend value is numeric as you are comparing 1 in if condition? 

 

Try if(newValue = "1")

{

}

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

    //Type appropriate comment here, and begin script below
    if (newValue == "1")
     {
        location.reload();
     }
}

 

location.reload()

tried but not working

On which filed your client script is?

 

Rosy14_0-1709886075915.png