Create link with variable in it's url?

  • Profile Image
    livro.ca
    Asked on December 13, 2017 at 09: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.

  • Profile Image
    Nik_C
    Answered on December 14, 2017 at 02:13 AM

    You can create a link in this way:

    1513235373Screen Shot 2017-12-14 at 8.13

    And here is how it works:

    1513235484Screen Shot 2017-12-14 at 8.13

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

    Could that work for you?

    Thank you!

  • Profile Image
    livro.ca
    Answered on December 14, 2017 at 02: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;" target="_blank" href="http://website.com/test/?{hiddenfield}">RETOUR AU MENU</a></center>

  • Profile Image
    Nik_C
    Answered on December 14, 2017 at 04: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!