简体   繁体   中英

How to trigger an external url redirect onformsubmitted

Anyone know how to trigger an external URL redirect onFormSubmitted?

I'm playing with custom code for a hubspot form, and previously i've used the code below which would redirect me to an internally linked page, but I can't seem to find code that would redirect to an external page.

For example, I want my on-demand webinar Hubspot form to redirect to the webinar recording which is hosted on vimeo - so i'd need to add the vimeo link

    onFormSubmitted: function($form) {
        window.location.replace("/thankyou"); // optional redirect

You seem to have it almost right (it's actually the same code, but I don't think the onFormSubmitted has $form as a parameter, which is the case with onFormSubmit):

onFormSubmitted: function() {
    window.location.href="the-vimeo-link";
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM