Kurumi Posted March 18, 2019 Report Share Posted March 18, 2019 I have this Submission DataPage with a dropdown/list box. After selecting a certain option, I wanted it to be redirected to another page. I followed this article: https://howto.caspio.com/tech-tips-and-articles/common-customizations/dynamic-redirects-after-form-submission/ However, the value I want to save is not the link for every option so I came up with this solution: The script below will automatically redirect you to the new page: <script type="text/javascript"> document.addEventListener('BeforeFormSubmit', function (event) { switch (document.getElementById("Id name of your field").value){ case 'ValueOfOption1': window.location="Link of the website"; break; case 'ValueOfOption2': break; case 'ValueOfOption3': break; default: window.location="Link of your datapage"; } }); </script> This one here will remain on the same page and at the same time open a new tab for the link: <script type="text/javascript"> document.addEventListener('BeforeFormSubmit', function (event) { switch (document.getElementById("Id name of your field").value){ case 'ValueOfOption1': window.open('Link of the website', '_blank'); break; case 'ValueOfOption2': break; case 'ValueOfOption3': break; default: window.location="Link of your datapage"; } }); </script> I have found this script from this Forum Post: Quote It really helps me to construct this so BIG THANKS for this! Quote Link to comment Share on other sites More sharing options...
MayMusic Posted March 19, 2019 Report Share Posted March 19, 2019 No need for JS. Create a lookup table which has both values to be saved and links. On your form add a virtual field and select cascading as the form element. Source of this element should be the lookup. Parent field is value and filter by values to be saved and as the value select the link. This virtual field would be the link to be redirected to. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.