• Resolved themikep87

    (@themikep87)


    Hello,

    I’m trying to set up a city selection form where the user selects the state/province to reveal the city drop down box. After they select the city name I want them to be able to click a button and hop to an anchor on the page.

    So far this is my form

    Dropdown: Select the State/Province

    Dropdown: Select the City (the value from this form should be used as the anchor in the button link)

    Button: This is what is in the onClick field – location.href=’#calgary’ but I want calgary to switch based on what is in the City drop down menu.

    This is what I want it to do – location.href=’#”fieldname3 value”‘

    Is this possible in this plugin?

    Thanks!

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello @themikep87

    I’ll try to describe the process with a hypothetical example.

    Assuming there are two fields in the form: fieldname1 and fieldname2 and you want pass it to the URL: http://www.website.com/page/?param1=<value of fieldname1>&param2=<value of fieldname2>

    First, insert a calculated field in the form, configured as hidden (there is checkbox in its settings for hiding it from the public form), and associate to it the equation:

    
    (function(){
    document.location.href="http://www.website.com/page/?param1="+fieldname1+"&param2="+fieldname2;
    })()
    

    Second, insert a calculate button in the form. It is a button field where you have selected the “Calculate” option as the button’s type.

    Finally, go to the “Form Settings” tab (https://cff.dwbooster.com/images/documentation/form-settings-tab.png), and untick the checkbox: “Eval dynamically the equations associated to the calculated fields”, to be sure the equation will be evaluated only by pressing the previous button.

    and that’s all.
    Best regards.

    Thread Starter themikep87

    (@themikep87)

    Got it! Thank you so much!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to use a dropdown field value as a button link?’ is closed to new replies.