Skip Navigation

[Resolved] Redirect cred on Submission to a Layout instead to a Page

This thread is resolved. Here is a description of the problem and solution.

Problem: I would like to redirect after a Form is submitted and show a specific Layout, but I can only select Pages.

Solution: Create a blank Page, apply the correct Layout. Redirect to that new Page.

This support ticket is created 5 years, 9 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 4 replies, has 2 voices.

Last updated by Nashaat 5 years, 9 months ago.

Assisted by: Christian Cox.

Author
Posts
#1198066

Hi,
I have several questions according redirects.

1- I would like to redirect a cred form to a specific Layout instead a specific page. Is this possible without adding redirect hooks?

2- i am using the button "delete post link". This also delete the post and could redirect to a specific page. Is it possible to redirect it to a specific layout?

I tried adding a custom url to the redirect instead to the number but this doesn't work.

3- i am using a custom javascript to hide a div when a user click submit. Tgis code works with any buttons as expected. I am trying to use this with cred submit button but seems not to work. How i hide the form when user click submit?

<button onclick="myFunction()">Click Me</button>

<div id="myDIV">
  This is my DIV element.
</div>
function myFunction() {
  var x = document.getElementById("myDIV");
  if (x.style.display === "none") {
    x.style.display = "block";
  } else {
    x.style.display = "none";
  }
}

New threads created by Christian Cox and linked to this one are listed below:

https://toolset.com/forums/topic/how-to-listen-for-form-submit-event/

#1198258

1- I would like to redirect a cred form to a specific Layout instead a specific page. Is this possible without adding redirect hooks?
2- i am using the button "delete post link". This also delete the post and could redirect to a specific page. Is it possible to redirect it to a specific layout?
It's not possible to display a Layout without applying that Layout to some post or page. In other words, a Layout doesn't have its own dedicated URL. You can use a URL parameter to programmatically apply a different Layout to the page containing the Form, or some other post or page:

<em><u>hidden link</u></em>

3- i am using a custom javascript to hide a div when a user click submit. Tgis code works with any buttons as expected. I am trying to use this with cred submit button but seems not to work. How i hide the form when user click submit?
I'm splitting this into a separate ticket. Our support policy is to only address one issue per ticket. The two previous questions are related, but this one is completely different.

#1198374

Thanks Christian,

I am not sure i get it. You can use a URL parameter to programmatically apply a different Layout to the page containing the Form, or some other post or page:

let me explain what i am doing maybe this could help us understand if possible or not.

1- user click on a post on fron end and choose the button "Delete Post" which will be called like following:

 <a onclick="showPopUp('[wpv-post-id]');" id="idOfTheIframeLoader_[wpv-post-id]" class="dropdown-item border-top py-2 pr-2" href="[wpv-post-url]?layout_id=454" target="myiFrame[wpv-post-id]">Delete Post</a>

2- once the iframe loads the layout with id 454 show up with a cred Delete Button

[cred_delete_post_link action='delete' text='Delete Forever' redirect='666' message_show='0' class='cred-refresh-after-delete']

3- user click on "Delete Forever" post get deleted and redirected to a page 666.

4- is there away to change the redirect "666" to something else that redirect to another layout? for example:

[cred_delete_post_link action='delete' text='Delete Forever' redirect='<em><u>hidden link</u></em>' message_show='0' class='cred-refresh-after-delete']

I have a custom Form for changing post status on the frontend, which redirect to a layout after submission. i would like to have the same process with Cred Delete button and Cred forms

<form name="front_end_publish" method="POST" action="<em><u>hidden link</u></em>">
       <input type="hidden" name="pid" id="pid" value="'.$post->ID.'">
       <input type="hidden" name="ps_priv" id="ps_priv" value="ps_priv">
       <button onclick="myFunctionHide()" class="btn btn-outline-danger btn-lg" type="submit" name="submit" id="submit">Make Post Private</button>
</form>
#1198857

4- is there away to change the redirect "666" to something else that redirect to another layout?
You can redirect to another Page where this Layout is applied.
1. Publish an new custom Page with no content
2. Apply Layout #486 to the new custom Page
3. Redirect to the new custom Page instead of yoursite.com/?layout_id=486

<em><u>hidden link</u></em>

You can only redirect to Pages, and you cannot apply URL parameters in the redirect. So the Layout must be applied to some Page in wp-admin.

#1200430

Thank you!