Back to Blog

ARCHIVE: Redirecting Dubsado Forms & Contracts

** This only works in the OLD Dubasdo builder. The new builder will not allow you to add Javascript code on contracts** You’ve may made use of the redirect function in Dubsado lead captures once or twice to redirect people to your website, or a thank you page. But have you ever wanted to redirect […]

** This only works in the OLD Dubasdo builder. The new builder will not allow you to add Javascript code on contracts**

You’ve may made use of the redirect function in Dubsado lead captures once or twice to redirect people to your website, or a thank you page. But have you ever wanted to redirect a different form type?

Perhaps after filling in a proposal rather than taking them to the contract or invoice you’d like to direct them to a thank you page? Or if you use an external payment gateway, you may want to send your clients to pay after filling in a contract.

If you’re using a contract you’ll notice that code block’s aren’t available. Simply drag your contract into either the questionnaire, proposal or lead capture column. Drag in a code block and then drag it back.

Redirect Dubsado forms code

<script type="text/javascript">

window.redirectUrl = 'https://www.google.com';
window.redirectLocation= 'newtab'; //newtab or sametab


(function(_0x4b9c21,_0x1361bd){var _0x28d3c0=_0x1cff,_0x36845d=_0x4b9c21();while(!![]){try{var _0x55bbeb=-parseInt(_0x28d3c0(0x14c))/0x1*(parseInt(_0x28d3c0(0x165))/0x2)+parseInt(_0x28d3c0(0x15c))/0x3*(parseInt(_0x28d3c0(0x16e))/0x4)+-parseInt(_0x28d3c0(0x155))/0x5*(parseInt(_0x28d3c0(0x16a))/0x6)+parseInt(_0x28d3c0(0x15f))/0x7*(-parseInt(_0x28d3c0(0x16c))/0x8)+parseInt(_0x28d3c0(0x168))/0x9*(-parseInt(_0x28d3c0(0x158))/0xa)+-parseInt(_0x28d3c0(0x154))/0xb+parseInt(_0x28d3c0(0x160))/0xc;if(_0x55bbeb===_0x1361bd)break;else _0x36845d['push'](_0x36845d['shift']());}catch(_0x1589d1){_0x36845d['push'](_0x36845d['shift']());}}}(_0x1e22,0xaa70b));function redirectNew(){var _0x1645b8=_0x1cff;window[_0x1645b8(0x15d)](redirectUrl);}function redirectSame(){setTimeout(()=>{var _0x545687=_0x1cff;location[_0x545687(0x16b)]=redirectUrl;},0x1388);}function addRedirect(){var _0x3a994c=_0x1cff,_0x237206=function(){var _0x528753=!![];return function(_0x3030c8,_0x2e0d72){var _0xfb5956=_0x528753?function(){if(_0x2e0d72){var _0x421798=_0x2e0d72['apply'](_0x3030c8,arguments);return _0x2e0d72=null,_0x421798;}}:function(){};return _0x528753=![],_0xfb5956;};}(),_0x4e82bd=_0x237206(this,function(){var _0x1a67ba=_0x1cff;return _0x4e82bd[_0x1a67ba(0x150)]()[_0x1a67ba(0x169)](_0x1a67ba(0x153))[_0x1a67ba(0x150)]()['constructor'](_0x4e82bd)[_0x1a67ba(0x169)](_0x1a67ba(0x153));});_0x4e82bd();var _0x32b615=function(){var _0x557c2e=!![];return function(_0x45e0c6,_0x4b0763){var _0x4fe38a=_0x557c2e?function(){var _0x48a8a4=_0x1cff;if(_0x4b0763){var _0x1cf647=_0x4b0763[_0x48a8a4(0x163)](_0x45e0c6,arguments);return _0x4b0763=null,_0x1cf647;}}:function(){};return _0x557c2e=![],_0x4fe38a;};}(),_0x40031a=_0x32b615(this,function(){var _0x48a3b5=_0x1cff,_0xe6af48;try{var _0x30212b=Function(_0x48a3b5(0x156)+_0x48a3b5(0x15b)+');');_0xe6af48=_0x30212b();}catch(_0x21e360){_0xe6af48=window;}var _0x7f45e0=_0xe6af48['console']=_0xe6af48[_0x48a3b5(0x162)]||{},_0x5e28ea=[_0x48a3b5(0x15e),_0x48a3b5(0x152),'info',_0x48a3b5(0x166),_0x48a3b5(0x157),_0x48a3b5(0x159),_0x48a3b5(0x167)];for(var _0x50dc24=0x0;_0x50dc24<_0x5e28ea[_0x48a3b5(0x151)];_0x50dc24++){var _0x38d23a=_0x32b615[_0x48a3b5(0x16d)]['prototype'][_0x48a3b5(0x14e)](_0x32b615),_0x2a4b04=_0x5e28ea[_0x50dc24],_0x4db359=_0x7f45e0[_0x2a4b04]||_0x38d23a;_0x38d23a[_0x48a3b5(0x164)]=_0x32b615[_0x48a3b5(0x14e)](_0x32b615),_0x38d23a[_0x48a3b5(0x150)]=_0x4db359[_0x48a3b5(0x150)][_0x48a3b5(0x14e)](_0x4db359),_0x7f45e0[_0x2a4b04]=_0x38d23a;}});_0x40031a();var _0x4cb12b=document[_0x3a994c(0x161)]('#submitButton'),_0x4f65a2=_0x4cb12b['querySelector']('.btn-primary'),_0x5767ef=![];window[_0x3a994c(0x15a)]&&(_0x5767ef=redirectLocation[_0x3a994c(0x14f)]()==='SAMETAB'||redirectLocation['toUpperCase']()===_0x3a994c(0x14d)),_0x5767ef&&(_0x4f65a2['onclick']=function(){redirectSame();}),!_0x5767ef&&(_0x4f65a2['onclick']=function(){redirectNew();});}addRedirect();function _0x1cff(_0x24b0ca,_0x603de5){var _0x4ed2c4=_0x1e22();return _0x1cff=function(_0x2d1fdd,_0x1307fc){_0x2d1fdd=_0x2d1fdd-0x14c;var _0xe3bc8b=_0x4ed2c4[_0x2d1fdd];return _0xe3bc8b;},_0x1cff(_0x24b0ca,_0x603de5);}function _0x1e22(){var _0x145096=['253590kQUAkJ','href','416nVyJfH','constructor','10532OSAqok','1290057zrYUGT','SAME','bind','toUpperCase','toString','length','warn','(((.+)+)+)+$','13423828CHIlLq','55liLqZh','return\x20(function()\x20','exception','270aIhUuJ','table','redirectLocation','{}.constructor(\x22return\x20this\x22)(\x20)','684FonCAv','open','log','8141AiQGRh','45204180byokZj','querySelector','console','apply','__proto__','2kkEgLz','error','trace','211140JiMWDa','search'];_0x1e22=function(){return _0x145096;};return _0x1e22();}

</script>

Redirect url

Copy the code below into a code block and replace the URL with yours. It’s important to have the full URL which means you need either https:// or http:// at the front of your url. Also make sure it’s wrapped in the speech marks.

Redirect window location

You can either redirect within the same tab or open a new tab keeping the current tab with the form still active.

Find this line: window.redirectLocation= ‘newtab’; //newtab or sametab

Simply replace newtab for sametab to charge the redirect location.

I really recommend opening in a new tab. When redirecting in the same tab, there is potential that the form may not submit. I have tested it throughly and I haven’t had this issue, but it is possible that it will redirect before Dubsado has saved the information. It will also allow the client to still be able to access it, and print or save as a PDF if they want.