Title: Button Link
Last modified: August 9, 2018

---

# Button Link

 *  Resolved [namazee](https://wordpress.org/support/users/namazee/)
 * (@namazee)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/button-link-13/)
 * Hi there,
 * The button function in the form, will it be able to be linked to a url, for example
   if i click the button it will be linked to a specific URL
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fbutton-link-13%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/button-link-13/#post-10575437)
 * Hello [@namazee](https://wordpress.org/support/users/namazee/),
 * It is simple javascript, entering as the onclick event of the button, a piece
   of code similar to the following one:
 *     ```
       document.location.href="http://www.the-website-domain.com/the-path-to-webpage";
       ```
   
 * Best regards.
 *  Thread Starter [namazee](https://wordpress.org/support/users/namazee/)
 * (@namazee)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/button-link-13/#post-10575600)
 * Hi,
 * I mean for example, if i create a dropdown list with two items, say item a and
   item b, if user selected item a and click button, it will leads to link A, if
   user selected item b in dropdown and click button, it will lead to link B.. will
   it be possible with implementation of IF statement
 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/button-link-13/#post-10575620)
 * Hello [@namazee](https://wordpress.org/support/users/namazee/),
 * You can simply insert a calculated field with the equation:
 *     ```
       (function(){
       if(fiedname1=='a') global_url = 'http://www.your-website-domain.com/page-a';
       if(fiedname1=='b') global_url = 'http://www.your-website-domain.com/page-b';
       })()
       ```
   
 * and then, the onclick event associated to the button would be:
 *     ```
       if(global_url) document.location.href=global_url;
       ```
   
 * and that’s all.
 * It is only an alternative, there are many other possibilities.
 * Best regards.
 *  Thread Starter [namazee](https://wordpress.org/support/users/namazee/)
 * (@namazee)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/button-link-13/#post-10577056)
 * Hi,
 * to pass the information selected from form A to form B.
 * For example in form A, user has selected Pickup country, pick up city, delivery
   country, delivery city, when the button is clicked to route them to the url together
   with the info they have selected in form A will be captured in form B.
 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/button-link-13/#post-10577880)
 * Hello [@namazee](https://wordpress.org/support/users/namazee/),
 * In this case you will need at least the Professional version of the plugin.
 * I’ll try to describe the process with a hypothetical example.
 * Assuming the form A includes the fields: fieldname1 and fieldname2, and you want
   pre-fill the fields: fieldname4 and fieldame9 in the form B with the values of
   fields in the form A:
 * – First, enter as the thank you page in the settings of the form A, the URL to
   the webpage where is inserted the form B.
 * – Second, into the content of the page where insert the shortcode of the form
   B, insert the shortcode for results to create the variable that define the default
   values of the fields in the form B:
 *     ```
       [CP_CALCULATED_FIELDS_RESULT]
       <SCRIPT>
       cpcff_default = { 1 : {} };
       cpcff_default[1][ 'fieldname4' ] = '<%fieldname1_value%>';
       cpcff_default[1][ 'fieldname9' ] = '<%fieldname2_value%>';
       </SCRIPT>
       [/CP_CALCULATED_FIELDS_RESULT]
       ```
   
 * and that’s all.
    More information in the following links:
 * [https://cff.dwbooster.com/documentation#populate-form](https://cff.dwbooster.com/documentation#populate-form)
   
   [https://cff.dwbooster.com/documentation#populate-form-b-with-a](https://cff.dwbooster.com/documentation#populate-form-b-with-a)
 * Best regards.
 *  Thread Starter [namazee](https://wordpress.org/support/users/namazee/)
 * (@namazee)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/button-link-13/#post-10577921)
 * (function(){
    if(fieldname1==’Air Express’) global_url = ‘[http://factohub.com/air-express/&#8217](http://factohub.com/air-express/&#8217);;
   if(fiedname1==’Sea Express’) global_url = ‘[http://factohub.com/sea-express/&#8217](http://factohub.com/sea-express/&#8217);;
   if(fieldname1==’Less Container Load (LCL)’) global_url = ‘[http://factohub.com/less-container-load-lcl/&#8217](http://factohub.com/less-container-load-lcl/&#8217);;
   if(fieldname1==’Full Container Load (FCL)’) global_url = ‘[http://factohub.com/full-container-load-fcl/&#8217](http://factohub.com/full-container-load-fcl/&#8217);;})()
 * ive used this code but only Air Express option is working, if others are selected,
   its not linking to the relevant page.
 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/button-link-13/#post-10577931)
 * Hello [@namazee](https://wordpress.org/support/users/namazee/),
 * Provide the URL to the webpage where is inserted the form you are editing, because
   the URL you sent me in the first ticket is not using this code:
 * [https://factohub.namaxee.com/air-express/](https://factohub.namaxee.com/air-express/)
 * Best regards.
 *  Thread Starter [namazee](https://wordpress.org/support/users/namazee/)
 * (@namazee)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/button-link-13/#post-10577985)
 * hi,
 * its [http://factohub.com/](http://factohub.com/)
 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/button-link-13/#post-10578045)
 * Hello [@namazee](https://wordpress.org/support/users/namazee/),
 * There is a typo in your equation: fiedname1 instead fieldname1
 * I’m sorry, but the free support service does not cover debugging your project.
   If you need a specialized support service, please, visit the following link:
 * [https://cff.dwbooster.com/support-policy](https://cff.dwbooster.com/support-policy)
 * Best regards.

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

The topic ‘Button Link’ 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/)

 * 9 replies
 * 2 participants
 * Last reply from: [codepeople](https://wordpress.org/support/users/codepeople/)
 * Last activity: [7 years, 10 months ago](https://wordpress.org/support/topic/button-link-13/#post-10578045)
 * Status: resolved