Jump to content

Recommended Posts

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!

 

Link to post
Share on other sites

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.

Link to post
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...