Perzival Posted November 17, 2018 Report Share Posted November 17, 2018 Hi there, I am using a report DataPage then on the results page, I want to have link button along with my data. So, on that link button I want to pass the parameter as a query string value. The problem is, the value that I am trying to pass in my results page, is a List - String Data type and contains a special character. I found some JavaScript code but none of them works for my case. Any idea? Thanks, Z Quote Link to comment Share on other sites More sharing options...
0 Harbinger Posted November 17, 2018 Report Share Posted November 17, 2018 Hi Z, Have you check encodeURI()? The encodeURI() function encodes a Uniform Resource Identifier (URI) by replacing each instance of certain characters by one, two, three, or four escape sequences representing the UTF-8 encoding of the character (will only be four escape sequences for characters composed of two "surrogate" characters). You may find the article here: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURI So i tried creating your test case, and this works for me: <div id="icon"></div> <script type="text/javascript"> var v_name = encodeURI("[@field:fieldName]"); v_name = v_name.replace(/&/gi,'%26'); v_name = v_name.replace(/&/gi,'%26'); document.write('<a href= https://yourURL?yourParameter=' + v_name + '>View Details</a>'); </script> Put the following code inside an HTML block, make sure that the checkbox "enable HTML editor" is not selected. You may check if this works for you. H Quote Link to comment Share on other sites More sharing options...
0 Heather Posted November 18, 2018 Report Share Posted November 18, 2018 I also tried the code, it really works! Thanks Harbinger! Harbinger 1 Quote Link to comment Share on other sites More sharing options...
Question
Perzival
Hi there,
I am using a report DataPage then on the results page, I want to have link button along with my data.
So, on that link button I want to pass the parameter as a query string value. The problem is, the value that I am trying to pass in my results page,
is a List - String Data type and contains a special character. I found some JavaScript code but none of them works for my case. Any idea?
Thanks,
Z
Link to comment
Share on other sites
2 answers to this question
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.