drop down menu question

GoLive Actions and Extensions - support, comments and suggestions.

drop down menu question

Postby Donnie Gardner » 01/20/2006 @ 12:19

I have created a very simple form to use as a service request for a chain of apartment complexes. When the client submits a request for service at one of the 13 complexes from the drop down menu I want the name (label) of the complex included in the email. The drop down menu is named recipient so it will direct the email to one of 6 email addresses using the value of the selection. Here is the address of the form http://ahmi.org/service.html. Thank you for your help.
Donnie Gardner
 
Posts: 10
Joined: 09/26/2005 @ 11:49

Postby Nate Baldwin » 01/20/2006 @ 15:36

Hi - I believe you're wanting the same thing from this thread...
http://www.mindpalette.com/forum/viewtopic.php?t=971

If not, or if you need more specific help on the code, just post back.
Nate Baldwin
Site Admin
 
Posts: 3724
Joined: 04/25/2003 @ 19:05

Postby Donnie Gardner » 01/23/2006 @ 13:00

My situation is a little different than the suggested thread.

// LIST OF EMAIL RECIPIENTS...
$recipients[1] = "dagwoodz@bellsouth.net";
$recipients[2] = "camelstreet@ahmi.org";
$recipients[3] = "parkside@ahmi.org";
$recipients[4] = "southwoods@ahmi.org";
$recipients[5] = "springvalley@ahmi.org";
$recipients[6] = "windhill@ahmi.org";
$recipients[7] = "woodview@ahmi.org";

Above is my list of recipients. Below is the list of options from my pulldown. What I want in the email that is generated is:If I select Autumn Drive I want the text Autumn Drive to be on the resulting email sent to recipient 1 and 2. You will also notice that several of the complexes will go to recipient 2. I want the names that are on the dropdown to appear in the resulting emails. Thanks for the help!!

[code]<option></option>
<option value="1,2">Autumn Drive</option>
<option value="6">Berryman Square</option>
<option value="2">Bingham/English Street Apts.</option>
<option value="2">Camel Courts</option>
<option value="2">Camel Street Apts.</option>
<option value="2">Everitt Square</option>
<option value="2">Everitt Street Apts.</option>
<option value="3">Laurence Manor</option>
<option value="3">Parkside Apts.</option>
<option value="4">Southwoods</option>
<option value="2">Spencer Street Apts.</option>
<option value="5">Spring Valley Apts.</option>
<option value="6">Windhill</option>
<option value="7">Woodview Apts.</option>
Donnie Gardner
 
Posts: 10
Joined: 09/26/2005 @ 11:49

Postby Nate Baldwin » 01/23/2006 @ 14:03

To do that, you'd probably need a JavaScript in the form page to read the select menu's label instead of the value, and then write that as the value of a hidden field that's passed with the form.

I can help you with that scirpt, if you want. But if you don't hear back, you might post again to remind me (tied up with something else right now).
Nate Baldwin
Site Admin
 
Posts: 3724
Joined: 04/25/2003 @ 19:05

Postby Donnie Gardner » 01/23/2006 @ 14:57

I will wait patiently for your help. Thank you very much!
Donnie Gardner
Donnie Gardner
 
Posts: 10
Joined: 09/26/2005 @ 11:49

Postby Nate Baldwin » 01/24/2006 @ 11:19

I think I have a simple JavaScript put together that will do the trick. Here's the example code...
Code: Select all
<script type="text/javascript" language="JavaScript1.2"><!--
function TransferLabel(thisMenu, thisForm) {
thisForm.selected_recipient.value=thisMenu.options[thisMenu.selectedIndex].text
}
//-->
</script>

<select name="recipient" size="1" onchange="TransferLabel(this, this.form);">
<option value=""><option>
<option value="1,2">Autumn Drive</option>
<option value="6">Berryman Square</option>
<option value="2">Bingham/English Street Apts.</option>
<option value="2">Camel Courts</option>
<option value="2">Camel Street Apts.</option>
<option value="2">Everitt Square</option>
<option value="2">Everitt Street Apts.</option>
<option value="3">Laurence Manor</option>
<option value="3">Parkside Apts.</option>
<option value="4">Southwoods</option>
<option value="2">Spencer Street Apts.</option>
<option value="5">Spring Valley Apts.</option>
<option value="6">Windhill</option>
<option value="7">Woodview Apts.</option>
</select>

<input type="hidden" name="selected_recipient" size="24">

So, add the <script> right above the selection menu HTML. The recipient menu won't change, except for adding that onchange bit to call the script function. There's a new hidden field added below that will receive the label text from the selected menu option so it's passed to the form.

If that doesn't seem to be working for you, please post back with a link to your test form page so I can see if it's conflicting with anything else. Or, email me a link with the contact form...
http://www.mindpalette.com/contact/
Nate Baldwin
Site Admin
 
Posts: 3724
Joined: 04/25/2003 @ 19:05

Postby Donnie Gardner » 02/08/2006 @ 15:24

I've noticed something unusual going on in explorer with this page(http://ahmi.org/Service05.html). It has an additional non active pulldown bar to the left of the active pull down menu. Do you know what may be causing that to happen. It doesn't appear in safari. Thanks for all your help!!
Donnie Gardner
Donnie Gardner
 
Posts: 10
Joined: 09/26/2005 @ 11:49

Postby Nate Baldwin » 02/08/2006 @ 16:18

It looks like your recipient menu is nested inside code for another menu?...
Code: Select all
<select name="Complex" size="1">

...then the recipient menu code...
Code: Select all
</select>

Any idea what that other menu code is doing there?
Nate Baldwin
Site Admin
 
Posts: 3724
Joined: 04/25/2003 @ 19:05

Postby Donnie Gardner » 02/08/2006 @ 16:42

I am pretty much a rookie. Can you help me out?
Thanks for everything.
Donnie
Donnie Gardner
 
Posts: 10
Joined: 09/26/2005 @ 11:49

Postby Donnie Gardner » 02/08/2006 @ 18:41

By deleating the code:<select name="Complex" size="1"> everything works just fine in both browsers. Thanks for being such a genius!
Donnie:)
Donnie Gardner
 
Posts: 10
Joined: 09/26/2005 @ 11:49

Postby Donnie Gardner » 02/09/2006 @ 13:01

Well it wasn't as simple as I thought on the previous post. But here is the code that did exactly what I wanted. I sure hope someone else can use this!
check out the code at http://ahmi.org/Service_Request.html
Who would think something this simple could be so complex.
Nate thanks for your help on everything
Donnie Gardner
Donnie Gardner
 
Posts: 10
Joined: 09/26/2005 @ 11:49


Return to GoLive Actions and Tutorials



Who is online

Users browsing this forum: No registered users and 3 guests

cron