Passing page values to a hidden form field

Discussion in 'Javascript' started by Jaygo, Jun 23, 2004.

  1. Jaygo

    Jaygo Guest

    I want to get the values from various page links to
    a hidden field in a single online form. So if visitor A links
    to the form from apples.htm and visitor B links to the
    form from oranges.htm the value in the db table field would be
    Apples or Oranges. Any pointers appreciated.

    TIA John
     
    Jaygo, Jun 23, 2004
    #1
    1. Advertising

  2. Jaygo

    kaeli Guest

    In article <>,
    enlightened us with...
    > I want to get the values from various page links to
    > a hidden field in a single online form. So if visitor A links
    > to the form from apples.htm and visitor B links to the
    > form from oranges.htm the value in the db table field would be
    > Apples or Oranges. Any pointers appreciated.
    >
    > TIA John
    >
    >
    >


    You could try document.referrer (or is it referer?), but I've heard it's
    rather unreliable for internet applications.
    A reliable method is to have the links on apples.htm and oranges.htm
    send a value themselves. This requires recoding the links, however.
    <a href="theURLwithTheForm.htm?ref=apples.htm">link</a>

    Then you'd parse the URL, get the value of ref, and populate your form.

    --
    --
    ~kaeli~
    Doing my part to piss off the Religious Right.
    http://www.ipwebdesign.net/wildAtHeart
    http://www.ipwebdesign.net/kaelisSpace
     
    kaeli, Jun 24, 2004
    #2
    1. Advertising

  3. Jaygo

    Jaygo Guest

    "kaeli" <> wrote in message
    news:...
    > In article <>,
    > enlightened us with...
    > You could try document.referrer (or is it referer?), but I've heard it's
    > rather unreliable for internet applications.
    > A reliable method is to have the links on apples.htm and oranges.htm
    > send a value themselves. This requires recoding the links, however.
    > <a href="theURLwithTheForm.htm?ref=apples.htm">link</a>
    >
    > Then you'd parse the URL, get the value of ref, and populate your form.
    >
    > --
    > --
    > ~kaeli~
    > Doing my part to piss off the Religious Right.
    > http://www.ipwebdesign.net/wildAtHeart
    > http://www.ipwebdesign.net/kaelisSpace

    Many thanks Kaeili, nice cats we also have
    two.

    John
     
    Jaygo, Jun 24, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Me
    Replies:
    2
    Views:
    653
    Steven Cheng[MSFT]
    Feb 24, 2004
  2. =?Utf-8?B?UGF1bA==?=
    Replies:
    14
    Views:
    1,156
    Juan T. Llibre
    May 13, 2005
  3. Rick
    Replies:
    3
    Views:
    8,376
    Alexey Smirnov
    Apr 13, 2010
  4. GavMc
    Replies:
    4
    Views:
    361
    Evertjan.
    Sep 22, 2005
  5. Matt
    Replies:
    1
    Views:
    152
Loading...

Share This Page