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

    (@codepeople)

    Hi,

    If the value of each choice in the dropdown field is an URL, and the name of the field is for example: fieldname1, you should insert a calculated field in the form with the equation:

    (function(){
    document.location.href=fieldname1;
    })()

    and that’s all.

    Best regards.

    Thread Starter norganics

    (@norganics)

    Sorry…confused. If I put that in a calculated field, wouldn’t I need the link location somewhere in the DS dropdown field? Or am I substituting the link location for “document.location.href” in the calculated field? Would it look like this: (function(){=fieldname1;})()?

    Thread Starter norganics

    (@norganics)

    Sorry, that’s not what I wrote. It was truncated when I posted the message. Try again:
    (function(){=fieldname1})()

    Thread Starter norganics

    (@norganics)

    Truncated again. I’ll need to email the script.

    Plugin Author codepeople

    (@codepeople)

    Hi,

    The script I sent you previously will navigate to the URL selected from the DropDown field.

    Best regards.

    Thread Starter norganics

    (@norganics)

    Okay. So I created a hidden DS field and made the settings direct it to a table column that contains the URLs. Then I created a hidden calculation field with the script you provided and directed it to the hidden DS field with the URL. At the preview, it immediately tries to find the first URL but fails, finding a 404 page instead. Then I created a button that would delay the calculation until a choice has been made…same result. I tried using the script in the button settings…same result. Then I put “SELECT” in the first row and first column with no URL in the second column so that it wouldn’t immediately direct to a URL…same result. What am I missing?

    Thread Starter norganics

    (@norganics)

    Should the URLs be in this format: ?

    Thread Starter norganics

    (@norganics)

    Arrrrrgh. Truncated again. I can’t seem to post the script I’m using.

    Thread Starter norganics

    (@norganics)

    Should the URLs be in this format
    <a href="https://domainname/pagename/"></a>

    Plugin Author codepeople

    (@codepeople)

    Hi,

    If you want to use the URL in the DropDown field to navigate dynamically, using the code I sent you previously, the URL should be simply:

    https://domainname/pagename/

    and not a link tag.

    Could you send me the link to your webpage and indicate the field with the URLs, please?

    Best regards.

    Thread Starter norganics

    (@norganics)

    https://norganics.com/test/

    There’s only one visible field and a go button. There’s a hidden DS field with the URLs and a hidden calculation field with your script.

    Plugin Author codepeople

    (@codepeople)

    Hi,

    Please, deactivate the dynamic evaluation of the equations in the “Form Settings” tab, or won’t be possible to check the form fields, because the web page is being redirected.

    Best regards.

    Thread Starter norganics

    (@norganics)

    Done

    Plugin Author codepeople

    (@codepeople)

    Hi,

    I’m sorry, my mistake.

    Please, replace the equation with the following one:

    (function(){
    if(fieldname2) document.location.href=fieldname2;
    })()

    Best regards.

    Thread Starter norganics

    (@norganics)

    I put that script in the calculated field but get the same result.

Viewing 15 replies - 1 through 15 (of 17 total)
  • The topic ‘Linked items in dropdown list’ is closed to new replies.