Reload page by onchange client script

Rosy14
Tera Guru

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

even msg is also not coming

I have just created an integer field and Client script and it is working as expected when I am changing the field value manually.

SN_Learn_0-1709888608223.pngSN_Learn_1-1709888644258.png



Could you please explain how you are doing the changes on that field in the form?

----------------------------------------------------------------
Mark this as Helpful / Accept the Solution if this helps.

function onChange(control, oldValue, newValue, isLoading, isTemplate) {
//Commneted is loading function try now
//if (isLoading || newValue === '') {
//return;
//}

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

not working

Hello @Rosy14 ,

 

Client script will work on form changes, if you are setting value form UI action and want to reload the page on the basis of value change it will not work.

 

I will suggest use "location.relod(true)" in UI action script