mark048 Posted August 18, 2017 Report Share Posted August 18, 2017 Hello, Is there a way to send an external html parameter, and to encapsulate it somehow? The problem I'm having is when a customer enters an "&" sign into the text fields, it throws the parameter off because of that sign. I need to send my parameters in an HTML link thanks! Quote Link to comment Share on other sites More sharing options...
douvega Posted August 19, 2017 Report Share Posted August 19, 2017 I think you can try using Javascript, specifically encodeURIComponent() You could encode only the value you are having issues with. Let me give you an example: <a id="myLink">Text to Display</a> <script> var field = document.getElementById("yourField"); var link = document.getElementById("myLink"); var encodedStr = encodeURIComponent(field.value); link.href = "yoururl.com?v1=test&v2=" + encodedStr; </script> I hope it helps. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.