Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 7351 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies
Posted

I am simply trying to capture the webpage from where users linked to my survey in a token, so that while the user is in the midst of my survey they can hit an exit button which will take them back to that webpage. I tried this, but it did not work:

<input type="hidden" name="-token.9" value="[javascript:history.back(1)]"

Thanks for your help

SBFB

Posted

Hmm... logic seems sound to me although I am not familiar w/JS enough to know anything about history.back(1). All I can think of is to test if [javascript:history.back(1)] returns the correct value of what you want and if so, check to see if WHERE code is on the page matters. Working with PHP for the 1st time this summer, I found that sometimes it matters where code is located in the sequence of execution (e.g. code dealing with headers will not work in body)... maybe history is header-specific?

Good luck, tho...

--ST

Posted

The Javascript will not "render" a string. It is a function/method of the "history" class, hence it does something when asked.

You may be able to do it like this:

<script>

document.write('<input type="hidden" name="-token.9" value="' + window.history[history.length-1] + "'>');

</script>

Good Luck.

Garry

This topic is 7351 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.