Support has been upgraded!
The Support Forum is closed. Not to worry! Providing the top quality support you expect and we're known for will continue! We're not ending support, just changing where you submit requests. This will provide you with the best experience possible.
Premium Support
Have you purchased an addon for Connections such as one of our premium templates or extensions with a valid license and you need help?
Please open a Support Ticket in your user account.
Free Support
Are you using the free Connections plugin? Don't worry, you are still very important to us! We are still providing you with the same high quality support that we're known for.
Please open a new support topic in the WordPress support forums for Connections.
- This topic has 11 replies, 2 voices, and was last updated 8 years, 2 months ago by
Chris LaMorte.
-
AuthorPosts
-
03/12/2015 at 4:05 pm #322581
Chris LaMorte
ParticipantHi, I need to have it set up so that instead of saying “Thank you” after the person submits their profile information, it redirects to a different page with a gravity form on it. How do I accomplish this?
03/13/2015 at 1:39 pm #322728Steven Zahm
Keymaster@ Chris
Since this all occurs via javascript there is no real easy way to do this as the
cn-form-user.js
file will need to be edited to add the redirect.Add the following to after lines
213
and220
but beforebreak;
// similar behavior as an HTTP redirect
window.location.replace("http://connections-pro.com");Obviously change
http://connections-pro.com
to the URL you want to redirect to.Save the file.
Make a copy of it and name it
cn-form-user.min.js
Upload both, overwriting both on the server.
Hope that helps!
03/19/2015 at 2:19 pm #323611Chris LaMorte
ParticipantI can’t seem to find this file. Can you tell me exactly where it is located?
03/19/2015 at 6:06 pm #323663Steven Zahm
Keymaster@ Chris
Here’s the path:
../wp-content/plugins/connections-form/js/
03/23/2015 at 5:14 pm #324158Chris LaMorte
ParticipantThanks so much for your help. I’m still having an issue. I edited the code on those lines as you said and although it is redirecting, it is causing the entry to not show up in the wordpress back end as it should. Here is my code, maybe you can point me in the right direction.
/** * @link http://stackoverflow.com/a/21583714 */ // if missing doctype (quirks mode) then will always use 'body' if ( document.compatMode !== 'CSS1Compat' ) return 'body'; // if there's a doctype (and your page should) // most browsers will support the scrollTop property on EITHER html OR body // we'll have to do a quick test to detect which one... // similar behavior as an HTTP redirect window.location.replace("https://gcba.org/?page_id=6044"); var html = document.documentElement; var body = document.body; // get our starting position. // pageYOffset works for all browsers except IE8 and below var startingY = window.pageYOffset || body.scrollTop || html.scrollTop; // similar behavior as an HTTP redirect window.location.replace("https://gcba.org/?page_id=6044"); // scroll the window down by 1px (scrollTo works in all browsers) var newY = startingY + 1; window.scrollTo(0, newY); // And check which property changed // FF and IE use only html. Safari uses only body. // Chrome has values for both, but says // body.scrollTop is deprecated when in Strict mode., // so let's check for html first. var element = ( html.scrollTop === newY ) ? 'html' : 'body'; // now reset back to the starting position window.scrollTo(0, startingY); return element; } }; CN_Form.init();
I would really appreciate it if you could help me figure out what I am doing wrong. Again, thank you so much for taking the time to help me out and being so patient. I also attached the file if that helps.
Attachments:
You must be logged in to view attached files.03/24/2015 at 11:59 am #324354Steven Zahm
Keymaster@ Chris
That is because the scroll to top occurs before the form data is sent to the server. So, essentially you’re redirecting the user before they are added. You should add the redirect to the
ajaxSuccess
callback. And only in the success cases which are 1,2 and 3. I would suggest add the redirect as a callback in thefadeIn
functions in cases 1 and 2. And in case 3, the redirect should be a callback added to thehtml
function. The reason is so the redirect occurs after the message is shown to the user. If they are not added as a callback the user will be redirected before the fade in effect finishes so they would never see the success messages.Hope that helps!
03/24/2015 at 2:26 pm #324395Chris LaMorte
ParticipantIs there any snippet of code that I can add and can you tell me where to put it? I’m not familiar with callbacks or javascript. I am confused now and have tried a number of things but had no success.
03/24/2015 at 4:07 pm #324405Steven Zahm
Keymaster@ Chris
My best guess at a snippet…
For
case 1:
, change this:$('#cn-form-message').html('<h3>' + cn_form.strSubmitted + '</h3>').hide().append('<p>' + cn_form.strSubmittedMsg + '</p>').fadeIn(1500);
to this:
$('#cn-form-message').html('<h3>' + cn_form.strSubmitted + '</h3>').hide().append('<p>' + cn_form.strSubmittedMsg + '</p>').fadeIn( 1500, function() { // similar behavior as an HTTP redirect window.location.replace("https://gcba.org/?page_id=6044"); });
03/24/2015 at 4:08 pm #324406Steven Zahm
Keymaster@ Chris
For reference: http://stackoverflow.com/a/8113838
03/25/2015 at 11:51 am #324472Chris LaMorte
ParticipantUgh, still not working. It says “An Error has Occured.” Is there any way I can pay extra for your assistance with this? I would really appreciate it. I’m under a lot of pressure to get this taken care of immediately.
Thanks!
Chris -
AuthorPosts
You cannot reply to this support topic. Please open your own support topic.