Plugin Contributor
Yuval
(@yuvalsabar)
Hi Alan,
In the next version we will add an option to add a script before redirection, so if you’ll add something like this: window.location.href = 'path/file.pdf'; you’ll get your way, but what I think will work best for you is to add the same code, only in the page that to user is redirected to, and you can do it right now of course, because that right now related to the plugin.
-
This reply was modified 8 years, 8 months ago by
Yuval.
-
This reply was modified 8 years, 8 months ago by
Yuval.
-
This reply was modified 8 years, 8 months ago by
Yuval.
Yuval, when I select a redirect page to THANKS and add script to the external box
window.location.href = ‘http://www.connectis.ca/v/babytel/d/babytel-t38-sip-trunking-product-sheet.pdf’;window.location.href = ‘http://www.connectis.ca/v/babytel/d/cryptagent-brochure.pdf’;
I can’t save the Contact7 form and get the error “You Must Enter A Valid URL”
The intention was to produce 3 tabs, Thanks + 2 more PDF datasheets.
What should I do.
Todah Rabah – Shanah Tovah
Hi @alan-nusbaum
Do you able to redirect to atleast one pdf uploaded in WordPress(wp-content) using the external box.
I need to redirect my page to the location where I uploaded my pdf after my form submit.
help me please.
Thanks in advance.
Plugin Contributor
Yuval
(@yuvalsabar)
@alan-nusbaum, like I said, you can do that easily by adding that script in the page that the user is redirected to. It’s not related to the Contact Form 7 forms, but to the thank you page. Nevertheless, you should know some browsers block script-triggered popup windows\tabs by default, so unless you allow it, it will prompt a warning.
-
This reply was modified 8 years, 8 months ago by
Yuval.
Yuval this isn’t a solution for me as the thankyou page is often used commonly by several other forms I use and I don’t want to pop up a tab with a PDF that has nothing to do with the current form. I expect I’ll have to wait and hope that you’ll produce something in your plugin that elegantly enables MULTIPLE External files to be defined.
thank you
Plugin Contributor
Yuval
(@yuvalsabar)
Hi @alan-nusbaum,
Just updated the plugin, now, in version 1.2, you can add multiple redirects, including files of course.
Please be kind and rate us π
Hi Yuval, I’ve upgraded the plugin and can now send a total of 2 PDF’s, but it’s still not working as expected. I’d like to send you a screenshot to further explain, but this blog doesn’t provide the facility. My email is [email protected] if you could send me yours, I’ll send you more details along with a screenshot so you’ll more easily understand my use case. Thanks in advance
Hi Alan (@alan-nusbaum). Did you solve the issue? I’m also trying to solve this.
Plugin Contributor
Yuval
(@yuvalsabar)
Hi @tardwe,
That can be done by adding a simple script to the textarea at the bottom of Redirect Settings tab:
window.open('YOUR URL OR FILE', '_blank');
Add two lines of the same – and two tabs will be opened, etc.
Ah. Thanks @yuvalsabar. Unfortunately I misread what Alan wanted to solve. My issue is that I would like to open different thank you pages based on the selected value of a radio button section in the form.
Plugin Contributor
Yuval
(@yuvalsabar)
Hi @tardwe,
It’s also possible to use the script textarea for that – by using the event object, check the select value and redirect accordingly.
There’s an example of a tested and working code:
The select field:
[select your_redirect_page "Home" "About"]
JavaScript Code
inputs = event.detail.inputs;
inputs.forEach( function(el) {
if ( el.name == 'your_redirect_page' ) {
if ( el.value == 'Home' ) {
location.href = 'http://yoursite.com/';
} else if ( el.value == 'About' ) {
location.href = 'http://yoursite.com/about/';
}
}
});
Notice all other inputs in the plugin should remain unfilled.
We’ve added this to the To-Do list for the next version of the plugin, so you should expect a build in support in a month or so π
-
This reply was modified 8 years, 6 months ago by
Yuval.
Hi again @yuvalsabar,
Sweet. Thank you so much. And great that you are adding this as a feature for next version as well π
All the best
TΓ₯rd
Awesome,
I can confirm this works for me.
I wanted a select drop down as a navigation.
Works perfectly.
Many thanks to all.
Thanks @yuvalsabar !!
That script did exactly what I needed!