Title: submit button generate dynamic link from calculated value
Last modified: September 1, 2016

---

# submit button generate dynamic link from calculated value

 *  Resolved [Red Giraffe](https://wordpress.org/support/users/red-giraffe/)
 * (@red-giraffe)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/submit-button-generate-dynamic-link-from-calculated-value/)
 * Hi there, amazing plugin!
 * Is there anyway I can customise the submit button to take the user to a different
   page, with the calculated number dynamically added to the link?
 * So for example the final calculated number is X, when you click submit it will
   take user to [http://www.mysite.com?amount=X](http://www.mysite.com?amount=X)
 * Thank you
 * [https://wordpress.org/plugins/calculated-fields-form/](https://wordpress.org/plugins/calculated-fields-form/)

Viewing 8 replies - 1 through 8 (of 8 total)

 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/submit-button-generate-dynamic-link-from-calculated-value/#post-7506923)
 * Hi,
 * You simply should enter the URL to the new page, as the thank you page associated
   to the form (in the form’s settings), and then, in the thank you page it is possible
   to insert the shortcodes to use the data collected by the form. Please, visit
   the following links with additional information:
 * [http://cff.dwbooster.com/documentation#thanks-page](http://cff.dwbooster.com/documentation#thanks-page)
 * [http://cff.dwbooster.com/documentation#special-tags](http://cff.dwbooster.com/documentation#special-tags)
 * Best regards.
 *  Thread Starter [Red Giraffe](https://wordpress.org/support/users/red-giraffe/)
 * (@red-giraffe)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/submit-button-generate-dynamic-link-from-calculated-value/#post-7506955)
 * thank you. This could work great – anyway to remove the <p> tags that wrap the
   result?
 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/submit-button-generate-dynamic-link-from-calculated-value/#post-7506956)
 * Hi,
 * Please, insert the result between `<pre>` tags to prevent that WordPress includes
   the `<p>` tags in the result. For example:
 *     ```
       [CP_CALCULATED_FIELDS_RESULT]
       <pre><%fieldname1_label%>:<%fieldname1_value%></pre>
       [/CP_CALCULATED_FIELDS_RESULT]
       ```
   
 * Best regards.
 *  Thread Starter [Red Giraffe](https://wordpress.org/support/users/red-giraffe/)
 * (@red-giraffe)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/submit-button-generate-dynamic-link-from-calculated-value/#post-7506961)
 * Ah I can’t get that to work 🙁 Sure there’s no way to add the value on to an 
   url? I’m trying to populate a payment form which would work perfectly if it could
   generate the url
 *  Thread Starter [Red Giraffe](https://wordpress.org/support/users/red-giraffe/)
 * (@red-giraffe)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/submit-button-generate-dynamic-link-from-calculated-value/#post-7506962)
 * For example, is there no way instead of submit button I could have some html 
   like:
 * [Click here to pay](http://www.mysite.com?value=%fieldmame1%)
 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/submit-button-generate-dynamic-link-from-calculated-value/#post-7506963)
 * Hi,
 * If you want redirect the user to a specific URL passing the value of a variable
   as parameter, for example: [http://www.yourdomain.com/?parameter=123](http://www.yourdomain.com/?parameter=123),
   You can do it directly from an equation associated to a calculated field in the
   form. For example:
 *     ```
       (function(){
       document.location.href='http://www.yourdomain.com/?parameter='+fieldname1;
       })()
       ```
   
 * or in the thank you page with the piece of code:
 *     ```
       [CP_CALCULATED_FIELDS_RESULT]
       <pre style="display:none;"><script>document.location.href="http://www.yourdomain.com/?parameter=<%fieldname1_value%>"</script></pre>
       [/CP_CALCULATED_FIELDS_RESULT]
       ```
   
 * Of course, you should modify the previous code to use the correct fields names,
   URLs, etc.
 * Best regards.
 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/submit-button-generate-dynamic-link-from-calculated-value/#post-7506966)
 * Hi,
 * Another solution would be generate the link you are referring from an equation.
   For example, if you insert a “HTML Content” field in the form, with the following
   piece of code as its content:
 * `<div id="link_container"></div>`
 * Then, it is possible to generate the link into the “link_container” div from 
   the equation, as follows:
 *     ```
       (function(){
       jQuery('#link_container').html('<a href="http://www.yourdomain.com/?parameter=fieldname1">Click here to pay</a>');
       })()
       ```
   
 * Best regards.
 *  Thread Starter [Red Giraffe](https://wordpress.org/support/users/red-giraffe/)
 * (@red-giraffe)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/submit-button-generate-dynamic-link-from-calculated-value/#post-7506969)
 * Oh my goodness that’s done the job perfectly! Thank you so much for this wonderful
   plugin 🙂

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘submit button generate dynamic link from calculated value’ is closed 
to new replies.

 * ![](https://ps.w.org/calculated-fields-form/assets/icon-256x256.jpg?rev=1734377)
 * [Calculated Fields Form](https://wordpress.org/plugins/calculated-fields-form/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/calculated-fields-form/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/calculated-fields-form/)
 * [Active Topics](https://wordpress.org/support/plugin/calculated-fields-form/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/calculated-fields-form/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/calculated-fields-form/reviews/)

 * 8 replies
 * 2 participants
 * Last reply from: [Red Giraffe](https://wordpress.org/support/users/red-giraffe/)
 * Last activity: [9 years, 10 months ago](https://wordpress.org/support/topic/submit-button-generate-dynamic-link-from-calculated-value/#post-7506969)
 * Status: resolved