Solved

passing value to formmail

Posted on 2009-07-02
4
230 Views
Last Modified: 2012-05-07
Hi,

Recently I have been asked to make a modification to the html form that calls it.

I use the id "recipient" on a select menu and depending the value selected from the drop down list, a specific person receives an email, like this:

<select name="recipient" id="recipient">
<option value="luisnava-gomez1@thisplace.com">Luisville, TEST</option>
<option value="luisnava-gomez2@thisplace.com">Jillville, TEST</option>
<option value="luisnava-gomez3@thisplace.com">Heatherton, TEST</option>
</select>

my question is:

passing the email value according to the value selected is working for luis1, luis2, and luis3. How can I also pass the values that is actually selected by the user?
in this case: Luisville, TEST, Jillville, TEST, Heatherton, TEST


Thank you much for your help.

0
Comment
Question by:itortu
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 5

Expert Comment

by:8riaN
ID: 24765091
Hard to tell exactly what you are asking.

Do you mean you want the email address of the recipient to show the text "Luisville, Test" text in the "to" address of the resulting email? In that case, replace your options list with the one below. Otherwise, explain what you want in more detail, please.

8riaN
<option value="Luisville, TEST <luisnava-gomez1@thisplace.com>">Luisville, TEST</option>
<option value="Jillville, TEST <luisnava-gomez2@thisplace.com>">Jillville, TEST</option>
<option value="Heatherton, TEST <luisnava-gomez3@thisplace.com>">Heatherton, TEST</option>

Open in new window

0
 

Author Comment

by:itortu
ID: 24765232
what i want is to be able to select "Luisville, TEST" and
then luisnava-gomez1 will receive the email and also the value "Luisville, TEST" in the email body.

if select "Jillville, TEST" then luisnava-gomez2 will receive the email and the value "Jillville, TEST" in the email body
0
 
LVL 5

Accepted Solution

by:
8riaN earned 250 total points
ID: 24765367
Then you'd need javascript to populate another hidden field.  Like this:


<head>
...
<script type="text/javascript">
function formSubmitted(thisForm) {
   with(thisForm) {
      nameSelected.value = recipient.options[recipient.selectedIndex].text;
   }
}
</script>
</head>
 
...
 
<form action="formmal.pl" method="post" onSubmit="formSubmitted(this) ;">
<input type="hidden" name="nameSelected">
...
</form>

Open in new window

0
 

Author Closing Comment

by:itortu
ID: 31599251
Thank you, that was exactly what I was looking for.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
SSRS - Powershell 7 73
Rename all files in a directory to numerical order 26 39
Renaming with batch file 9 106
powershell switch statement 7 46
In this tutorial I will show you how to make a simple HTML bar chart with the usage of WhizBase, If you want more information about WhizBase please read my previous articles at http://www.experts-exchange.com/ARTH_5123186.html (http://www.experts-ex…
Batch, VBS, and scripts in general are incredibly useful for repetitive tasks.  Some tasks can take a while to complete and it can be annoying to check back only to discover that your script finished 5 minutes ago.  Some scripts may complete nearly …
The viewer will learn how to dynamically set the form action using jQuery.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question