Auto Input to Form Challenge.

  • willstein
  • Loser
  • Loser
  • willstein
  • Posts: 117
  • Loc: Maryland

Post 3+ Months Ago

I need help creating an Auto input to a form.
For instance, I have a form and I want it to automatically have a variable inserted in it. Like the word "Dog", or "House", for example.

But this is the challenge:
I want the variable to be taken from the history, and bring in (-1) the last URL the user was at.

Why?

My error page:
http://www.lavashark.com/thispagedoesnotexist

My error page has a form to input information so that we can fix the broken link. It would be neat if automatically the form said - Last page visited: "URL". Then all they would have to do is push the submit button. Or it would be great if the form submitted itself on its own. Now that, would be an error page.

I don't think this has been done yet, and this could prove to be very valuable for many websites.

Any Suggestions?
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • RichB
  • Guru
  • Guru
  • User avatar
  • Posts: 1121
  • Loc: Boston

Post 3+ Months Ago

As far as I know, you're not allowed to access the list of urls in the history object for security reasons. You could try using the document.referrer property as it should contain the URL of the linked-from document. That would give you the page that they were coming from if they clicked a link, although it wouldn't give you the URL they were trying to reach and it won't give you anything if they type directly into the address bar.
  • willstein
  • Loser
  • Loser
  • willstein
  • Posts: 117
  • Loc: Maryland

Post 3+ Months Ago

Well I'm sure there is someway, becuase from my knowledge, webstats program's will tell you 90% of your traffic is coming from google.com . . . 5% . . . etc.


Doesn't this use a similiar measure?
  • RichB
  • Guru
  • Guru
  • User avatar
  • Posts: 1121
  • Loc: Boston

Post 3+ Months Ago

Yeah, they get the referral url, which you can access through document.referrer.

Click here for a demonstration.
  • willstein
  • Loser
  • Loser
  • willstein
  • Posts: 117
  • Loc: Maryland

Post 3+ Months Ago

WOWZERS!

you did it!

but, but, but. . . . .



speech.
speech
speeech.
:shock:

Post Information

  • Total Posts in this topic: 5 posts
  • Users browsing this forum: No registered users and 52 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.