September 18, 200421 yr Newbies 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
September 21, 200421 yr 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
September 22, 200421 yr 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
September 25, 200421 yr Author Newbies Thanks for the input....but the javascript doesn't seem to work. When I check what is in token 9 on the following page it is blank. Any other ideas?
September 25, 200421 yr Re: When I check what is in token 9 on the following page it is blank. If a token is blank on the next page that means the token has not be set.
September 30, 200421 yr Author Newbies Right. Which means that the javascript that Garry supplied is never setting the token...Any other ideas?
Create an account or sign in to comment