Jump to content
  • 0

How to receive a URL parameter into a parameter in a URL string in an HTML datapage


serialfunk

Question

I have a URL parameter that is correctly passing the parameter from Page 1 to Page 2.

On Page 2, I have an HTML DataPage that is supposed to receive my parameter from the URL, but it's not receiving it.

My HTML DataPage contains a button, and it's this button that is supposed to receive the parameter, so that when the button is clicked, it passes the parameter to Page 3, which is my Submission Form DataPage.

Any ideas on what I'm doing wrong and what I can do to fix it?

Link to comment
Share on other sites

7 answers to this question

Recommended Posts

  • 0

How exactly are you receiving the parameter on the 2nd page?

If you can see the parameter on the URL, you should be able to pull it to your datapage by using [@parameter_name] on the HTML block or header/footer.

Ex. MyURL.com?testparam=12

To receive that parameter on an HTML block, you will need to mention a '[@testparam]' there.

May we please have a sample on how do you have it on your end?

Link to comment
Share on other sites

  • 0

If you have it set up as NiceDuck described, and you are sure that the parameter name in the URL is the same with the [@parameter_name], you should be getting it. A good test is to try calling it by itself first before applying to a button to see if a value is being received. You can just like disable html editor on the HTML datapage and put [@testparam] then preview it. If it show the value then you are receiving it and might just a problem in using the value for the redirection.

Link to comment
Share on other sites

  • 0

Hi - Just wanted to share this solution. If you would like to get and display a field value/external parameter on an external HTML page, you can follow these steps:

1. Add an HTML code as a holder of the parameter, for example:

<span id="user"></span>

2. Insert a JavaScript, call and display the parameter in the holder.

<script>

const queryString = window.location.search;
const urlParams = new URLSearchParams(queryString);
const userParam = urlParams.get('param');
document.getElementById("user").innerHTML = userParam;

</script>

The param is the name of the parameter from an external URL.

For reference: https://stackoverflow.com/questions/71727647/displaying-url-parameter-values-as-text-in-an-element-on-webpage-question-from

Link to comment
Share on other sites

  • 0
On 9/24/2022 at 4:36 AM, Meekeee said:

Hi - Just wanted to share this solution. If you would like to get and display a field value/external parameter on an external HTML page, you can follow these steps:

1. Add an HTML code as a holder of the parameter, for example:

<span id="user"></span>

2. Insert a JavaScript, call and display the parameter in the holder.

<script>

const queryString = window.location.search;
const urlParams = new URLSearchParams(queryString);
const userParam = urlParams.get('param');
document.getElementById("user").innerHTML = userParam;

</script>

The param is the name of the parameter from an external URL.

For reference: https://stackoverflow.com/questions/71727647/displaying-url-parameter-values-as-text-in-an-element-on-webpage-question-from

@Meekeee Perfect

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