Title: Function behind button
Last modified: August 22, 2016

---

# Function behind button

 *  Resolved [Startuptrainer](https://wordpress.org/support/users/startuptrainer/)
 * (@startuptrainer)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/function-behind-button/)
 * Hi, I want to put behind the button the function , the value of which is depending
   on , of all things , a different page is opened
 * There is a price calculator , and depending on the composition of the individual
   items, the relevant product page to be opened.
 * Who can help me?
 * many greetings
 * [https://wordpress.org/plugins/calculated-fields-form/](https://wordpress.org/plugins/calculated-fields-form/)

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

 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/function-behind-button/#post-5652208)
 * Hi,
 * I don’t know exactly the behavior you need in the form, but if you want navigate
   to a different page, depending of fields values, you can use the following code
   as part of the equation that check the fields values:
 * document.location.href=”[http://www.yourwebsite.com/the_web_page.html&#8221](http://www.yourwebsite.com/the_web_page.html&#8221);;
 * Best regards.
 *  Thread Starter [Startuptrainer](https://wordpress.org/support/users/startuptrainer/)
 * (@startuptrainer)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/function-behind-button/#post-5652213)
 * It is a price calculater and behind the button the user should get the Page of
   the specific Produkt
 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/function-behind-button/#post-5652258)
 * Hi,
 * In this case you can create a global javascript variable from the equation, with
   the URL of the product’s page based in the data entered in the form fields:
 * global_url = “[http://www.yourwebsite.com/the_web_page.html&#8221](http://www.yourwebsite.com/the_web_page.html&#8221);;
 * and then, in the onclick event of the button, use the code:
 * document.location.href=global_url;
 * If you need a custom coding, please contact us through our support page:
 * [http://wordpress.dwbooster.com/support](http://wordpress.dwbooster.com/support)
 * Best regards.

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

The topic ‘Function behind button’ 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/)

## Tags

 * [button](https://wordpress.org/support/topic-tag/button/)
 * [function](https://wordpress.org/support/topic-tag/function/)

 * 3 replies
 * 2 participants
 * Last reply from: [codepeople](https://wordpress.org/support/users/codepeople/)
 * Last activity: [11 years, 2 months ago](https://wordpress.org/support/topic/function-behind-button/#post-5652258)
 * Status: resolved