<p>When I use this code (taken straight from the <a href="https://github.com/pixelandtonic/ContactForm#redirecting-after-submit" rel="nofollow">readme</a>)</p>

<pre><code> &lt;input type="hidden" name="redirect" value="contact/thanks?from={fromName}"&gt;
</code></pre>

<p>The emails sends fine and I get redirected to the page as expected however the url in the title bar is exactly that:</p>

<pre><code>http://ontherocks.dev/contact/thanks?from={fromName}
</code></pre>

<p>and this line also straight from the <a href="https://github.com/pixelandtonic/ContactForm#redirecting-after-submit" rel="nofollow">readme</a>:</p>

<pre><code>&lt;p&gt;Thanks for sending that in, {{ craft.request.getQuery('from') }}!&lt;/p&gt;
</code></pre>

<p>renders as:</p>

<pre><code>Thanks for sending that in, {fromName},
</code></pre>

<p>No idea what I'm doing wrong, problem something glaringly simple.
Anyone care to shed some light on the correct way to do this?</p>

CC BY-SA 3.0
2015-02-17T09:20:08.070Z
Can you post the POST data that is sent over when you submit?
Moin Qidwai
CC BY-SA 3.0
2015-02-17T16:33:36.673Z
Are you using that first line in the Control Panel or in your template? If using it in your template then you might try using double brackets. i.e. `<input type="hidden" name="redirect" value="contact/thanks?from={{ fromName }}">`.
Douglas McDonald
CC BY-SA 3.0
2015-02-18T10:29:01.977Z
@DouglasMcDonald The code is for the form in one of my templates. I tried double brackets but that just throws an error saying that {{fromName}} is not defined.
j00lz
CC BY-SA 3.0
2015-02-18T10:29:38.963Z
And @MoinQidwai the postdata can't be used it's just sending the {fromName} as explained in the last code quote....
j00lz
CC BY-SA 3.0
2015-02-22T13:40:01.007Z
Oh I meant the formdata that is going to be posted once you submit the form. Do you know how to get that data? Actually all I need to know is the value of the field with name="fromName".
Moin Qidwai
CC BY-SA 3.0
2015-02-28T05:55:49.097Z
@MoinQidwai I'm guessing that I'm going to have to write javascript code to get the value of the forms.... I thought that the plugin handled it and can't understand how to use it as intended.
j00lz
CC BY-SA 3.0
2015-02-28T08:10:06.210Z
@j00lz I have done exactly what you are trying to do in your question and it works for me so Im not sure what the main issue is without more info. Anyway if you need any help let me know.
Moin Qidwai
<redirect>
Redirect URL variables with ContactForm plugin
# Redirect URL variables with ContactForm plugin

(Asked by: username_0 on 2015-02-17)

When I use this code (taken straight from the readme)
 

The emails sends fine and I get redirected to the page as expected however the url in the title bar is exactly that:
http://ontherocks.dev/contact/thanks?from={fromName}

and this line also straight from the readme:
Thanks for sending that in, {{ craft.request.getQuery('from') }}!

renders as:
Thanks for sending that in, {fromName},

No idea what I'm doing wrong, problem something glaringly simple.
Anyone care to shed some light on the correct way to do this?

**Tags:** redirect
> **Comments:**
> **username_1**: Can you post the POST data that is sent over when you submit?  
> **username_2**: Are you using that first line in the Control Panel or in your template? If using it in your template then you might try using double brackets. i.e. `<input type="hidden" name="redirect" value="contact/thanks?from={{ fromName }}">`.  
> **username_0**: @DouglasMcDonald The code is for the form in one of my templates. I tried double brackets but that just throws an error saying that {{fromName}} is not defined.  
> **username_0**: And @MoinQidwai the postdata can't be used it's just sending the {fromName} as explained in the last code quote....  
> **username_1**: Oh I meant the formdata that is going to be posted once you submit the form. Do you know how to get that data? Actually all I need to know is the value of the field with name="fromName".  
> **username_0**: @MoinQidwai I'm guessing that I'm going to have to write javascript code to get the value of the forms.... I thought that the plugin handled it and can't understand how to use it as intended.  
> **username_1**: @j00lz I have done exactly what you are trying to do in your question and it works for me so Im not sure what the main issue is without more info. Anyway if you need any help let me know.  

---

## 0 answers

