ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Safecracker return=

April 20, 2012 2:25am

Subscribe [2]
  • #1 / Apr 20, 2012 2:25am

    JPDesignDev

    20 posts

    I have a Safecracker form that is working as expected for the most part. The one thing I can’t figure out is how I can return the user to a thank you page, which links them back to the URL they completed the form from.


    Here is a little piece of the code used to begin the safecracker form in case it’s needed.

    {exp:safecracker
     channel="contact_requests"
     return="/thank-you"
     url-title="{!-- Leave Empty to add a new entry --}"
     entry_id="{!-- Leave Empty to add a new entry --}"
     include_jquery="no"
     dynamic_title="Quote Request from [first_name] [last_name] on {current_time format='%F %d, %Y - %g:%i:%s'}"
     logged_out_member_id="X"
     preserve_checkboxes=“yes”
     error_handling="inline"
    }


    BTW, I’m currently saving the “Full URL” to the page used to submit the form to the Channel in a custom field called {page_accessed}. This information is stored in a hidden input like so,

    <input type=“hidden” name=“page_accessed” value=”{exp:current_url:full_url}” />

    It would be nice if I could store this data to the custom field without using a “hidden” input because anyone could edit/insert their own value with a tool like Firebug. How can this be done?

  • #2 / Apr 20, 2012 5:35pm

    Shane Eckert

    7174 posts

    Hey JPDesignDev,

    I am sorry to hear you are running into this problem.

    In the return statement. What is return=”/thank-you” pointing to? If this is a template in the main group then you will need to use return=“thank-you” or if it’s in another template group then use return=“group/thank-you”.

    I am not sure how to accomplish your second question. I can move this thread to Development and Programming if you would like.

    Cheers,

  • #3 / Apr 20, 2012 8:10pm

    JPDesignDev

    20 posts

    Sorry, it’s actually like this in the template already

    return=“thank-you”

    Referencing the correct thank-you template is not the issue though. I would like to know how I can pass the {exp:current_url:full_url} (the link the form was submitted from) data to the thank-you page, so I can ask users if they would like to go back to the page which they access the form, or go elsewhere if they like.

  • #4 / Apr 23, 2012 5:41pm

    Shane Eckert

    7174 posts

    Hey JPDesignDev,

    You could just use

    $_SERVER['HTTP_REFERER']

    .

    I am not sure how you would use {exp:current_url:full_url} in this way.

    Cheers,

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases