Create link with variable in it's url?

  • livro.ca
    Asked on December 13, 2017 at 9:55 PM

    Hi,

    If I have a prefilled hidden field; any way I can use the variable to insert into a link within a text.

    I tried linking to: xyz.com/?{formfield}
    but it actually links to that as is rather than replacing {formfield} with the value of {formfield} response.

  • Nik_C
    Replied on December 14, 2017 at 2:13 AM

    You can create a link in this way:

    1513235373Screen Shot 2017 12 14 at 8 Screenshot 10

    And here is how it works:

    1513235484Screen Shot 2017 12 14 at 8 Screenshot 21

    Please check my test form as well: https://form.jotform.com/73471221065954

    Could that work for you?

    Thank you!

  • livro.ca
    Replied on December 14, 2017 at 2:15 AM

    actually no; the link is within some css/html:

    <center><a style="text-decoration: none; padding: 6px 8px; color: #a96d17; background: #ffffe0; border: 1px solid brown; border-radius: 10px;" href="http://website.com/test/?{hiddenfield}">RETOUR AU MENU</a></center>

  • Nik_C
    Replied on December 14, 2017 at 4:23 AM

    Unfortunately, that will not work in our builder, you cannot insert field's value in the href attribute. At least, that is not possible with clean HTML, you have to use JavaScript in order to construct such URL. 

    These guides should be useful:

    https://stackoverflow.com/questions/975050/passing-javascript-variable-to-a-href

    https://answers.laserfiche.com/questions/84194/Insert-a-variable-into-hyperlink

    And such solution cannot be implemented in our builder, you would have to download the Source code of the form and apply it there, then upload to your own domain.

    Hope it helps.

    Thank you!