Jump to content
  • 0

Passing Parameter


Perzival

Question

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

  • 0

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(/&amp;/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

Link to comment
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
Answer this question...

×   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...