Auto population of field from a link

Ask a Question related to Macromedia Dynamic HTML, Design and Development.

  1. #1

    Default Auto population of field from a link

    I am trying to automatically select an option from a drop down list on a
    contact form when a user clicks on a link from another page. For example, the
    user is on a page relating to a specic product and I want them to contact us
    about it via our web contact form, and to save them having to re-select the
    product from the list (already existing on the form) Iwant to select it for
    them.

    Is this possible and more importantly, how?

    Many thanks for your help.

    oholmes Guest

  2. Similar Questions and Discussions

    1. Forms: Text field - auto fill another field?
      Someone PLEASE help me... how do i structure a form so that when text is entered into one field, it auto-fills other fields on the form that are...
    2. Auto-Click LInk
      I was just wondering if there is some kind of code so that I can have my "http://www.myspace.com" website to point to this website automatically. I...
    3. auto 'jump' to link
      I've seen this somewhere (or I've gone crazy), but a function in PHP that automatically forwards you to another web page. If want to do an 'if x=5...
    4. [PHP] auto 'jump' to link
      if ($x == 5) header('Location: http://blah.com/blah'); This what you were looking for? Also make sure this is sent before any other output ...
    5. PHP Auto Link
      On 31 Aug 2003 22:44:04 -0700 jskeith1@san.rr.com (Jeff Skeith) wrote: Try using header redirects:...
  3. #2

    Default Re: Auto population of field from a link

    One way is to do it with your server side language (such as PHP). Essentially,
    what you would do is keep your entire list as it is in the dropdown box, but
    add a field before the list which will be populated with the selection as
    passed by url

    1. Add a variable to the link's href by appending it after a '?' For example,
    <a href="contact.php"> could become <a href="contact.php?cont=contact1">
    2. Retrieve that value on the contact page with server side code: $contact =
    $_GET['cont']
    3. Use that variable to create the first value in the dropdown list (you can
    also assign that value to a dummy row as I did below if you want something to
    separate the currently selected item from the rest of the list.

    HTML:

    <form>
    <select name="contacts">
    <option value="<?php echo($contact); ?>"><?php echo($contact); ?> </option>
    <option value="<?php echo($contact); ?>">--------------------- </option>
    <option value="contact1">contact 1 </option>
    <option value="contact2">contact 2 </option>
    </form>


    Hope that helps. You could also do it with Javascript, but this way is more
    reliable.

    rilkesf Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139