Ask a Question related to Macromedia Dynamic HTML, Design and Development.
-
oholmes #1
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
-
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... -
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... -
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... -
[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 ... -
PHP Auto Link
On 31 Aug 2003 22:44:04 -0700 jskeith1@san.rr.com (Jeff Skeith) wrote: Try using header redirects:... -
rilkesf #2
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



Reply With Quote

