Page 1 of 1

Redirect to static page basen on field value

Posted: 11 Jan 2018
by Cloud.Ed
We are happy with the default redirects and the ability to redirect to the edit form after creation of a new form. Next, we want to, on save, test a field value and based on that value redirect to different lists view, a static URL. I hope that makes sense.

Re: Redirect to static page basen on field value

Posted: 11 Jan 2018
by Dmitry Kozlov
Sure, just modify the snippet below accordingly to your needs:

Code: Select all

fd.onsubmit(function() {
    if (fd.field('Field1').value() == 'XXX') {
        // if the Field1 is set to 'XXX', redirect users to URL1 after saving;
        fd.sourceFormParam('URL1');
    } else {
        // redirect users to URL2 otherwise;
        fd.sourceFormParam('URL2');
    }
    
    return true;
})