Skip navigation
Currently Being Moderated

Hidden field in form with page url value

Feb 6, 2013 11:12 AM

Tags: #help #form #hidden_field #field_value #page_url

Hello Dreamweaver world,


Just got a quick question im stuck on.

I am creating a simple form including Name, Email and Message. The trouble is I want to use the same form on many different pages but still being able to tell which URL the form was sent from. I see that I want a hidden field in the form but how would I go about making it send the URL with the other information sent?


Thanks in advance!

  • Currently Being Moderated
    Feb 6, 2013 12:17 PM   in reply to Torlock1

    Best done server-side (ColdFusion, ASP, PHP, etc.)   In ColdFusion you can use #cgi.script_name# to get the document name that contains the form.


    However, you can use JavaScript (not as reliable - esp if user has JS disabled.)


    location.href or document.URL will have the FQDN path including document name.  Be sure to access the page via FQDN or http://localhost or  If you access it via file:\\\C:\path\to\document.htm, then I'm not sure how that will work.



    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points