How can I safely encode special characters in the URL

  • chess1170
    Asked on December 14, 2017 at 3:33 PM

    I have some fields I am trying to forward to a 2nd form that often have a "#" in the text.  I need to forward this over to the 2nd field.  How can I do this since the url will not read # as a text character?


    I know "%23" is the code that should be in the url instead.  but how do I dynamically change the "#" to "%23."

    I either need CSS code to change the pound symbol in the field to the html code, or some way to do a calculated field with the pound sign replaced.

  • chess1170
    Replied on December 14, 2017 at 3:58 PM

    I actually figured out how to do it.  If anyone is interested:


    When putting the field into the url format, add "URLENCODE:" before the field ID.


    For example if I have a "First Name" field that I want in a url, I typically would use:

    {firstName}

    instead, use:

    {URLENCODE:firstName}

    this will change any character that is not URL friendly to its URL encoded characters.

  • Support_Management Jotform Support
    Replied on December 14, 2017 at 6:05 PM

    Thanks for sharing that info - That's correct, using the URLENCODE prefix in the URL would convert these to URL encoded characters.

    Related guide: Pass-Value-to-Another-Form-with-URL-Encoding 

    If you have other questions, don't hesitate to open a new thread.