Solved

Select email address from drop-down box.

Posted on 2001-07-19
8
206 Views
Last Modified: 2010-04-07
I have a Contact Us form and would like to have the email sent to the person that is selected from a drop-down box.

Is there an easy way to do this??? Thanks
0
Comment
Question by:LTurk
  • 5
  • 3
8 Comments
 
LVL 3

Expert Comment

by:MHQ
ID: 6302457
Do you have a cgi or similar to handle to sendinbg of the e-mail or do you mean opening up the visitors mail-program with the correct adress?

/MHQ
0
 

Author Comment

by:LTurk
ID: 6302482
I created most of the site with DreamWeaver but I created the Contact Us Form with Front Page because it is so easy to do in Front Page.  Therefore I didn't have to bother with a cgi.

0
 
LVL 3

Expert Comment

by:MHQ
ID: 6302497
You still need a serverside function to send the mail unless you use the visitors own mailing program. I guess this is what you are planning on doing so let me work out a solution for you.

/MHQ
0
 

Author Comment

by:LTurk
ID: 6302579
I'm still a beginner at web pages so I'm not sure what I need or use. But there's hope - I am signing up for some classes next week:) But in front page all you do is create the form,go into the form properties, and type in the email address of where you want the info to be emailed to. I think i read somewhere that it does create a cgi for you but it is hidden and not something you can edit.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 3

Expert Comment

by:MHQ
ID: 6302600
This should do it for you!

<script>
function mail(tt)
{
if (tt.form.myselect.value!="") {
tt.form.action="mailto:"+tt.form.myselect.value+"?subject="+tt.form.mysubject.value+"&body="+tt.form.themessage.value+"&";
tt.form.submit();
}
 else {
alert("You must choose a recipient!");
}
return false;
}
</script>
<form action="mailto:BobA@yy.com" name=myform>
Recipient:<br>
<select name=myselect>
<option value="">Select a person
<option value=BobA@yy.com>Bob A
<option value=BobB@yy.com>Bob B
<option value=BobC@yy.com>Bob C
<option value=BobD@yy.com>Bob D
</select>
<br>
Subject:<br>
<input type=text name=mysubject>
<br>
Message:<br>
<textarea name=themessage>
Type your message here
</textarea>
<br>
<input type=button value=Send email onclick=mail(this);>
</form>

Regards,
MHQ
0
 

Author Comment

by:LTurk
ID: 6302691
Does all that go into the Submit Button?
0
 
LVL 3

Accepted Solution

by:
MHQ earned 100 total points
ID: 6302729
Copy and paste the code below into the code of new document.

As you can see, I have removed the submit button and andded a regular button instead which calls the function that constructs the message and sends it.

I don't know how used you are to working directly with the code of HTML and javascript, if you need more explanation, just say so.

<html>
<head>
<script>
function mail(tt)
{
if (tt.form.myselect.value!="") {
tt.form.action="mailto:"+tt.form.myselect.value+"?subject="+tt.form.mysubject.value+"&body="+tt.form.themessage.value+"&";
tt.form.submit();
}
else {
alert("You must choose a recipient!");
}
return false;
}
</script>
</head>
<body>
<form action="mailto:BobA@yy.com" name=myform>
Recipient:<br>
<select name=myselect>
<option value="">Select a person
<option value=BobA@yy.com>Bob A
<option value=BobB@yy.com>Bob B
<option value=BobC@yy.com>Bob C
<option value=BobD@yy.com>Bob D
</select>
<br>
Subject:<br>
<input type=text name=mysubject>
<br>
Message:<br>
<textarea name=themessage>
Type your message here
</textarea>
<br>
<input type=button value=Send email onclick=mail(this);>
</form>
</body>
</html>

Regards,
MHQ
0
 
LVL 3

Expert Comment

by:MHQ
ID: 6309332
Glad it worked as you wanted! =)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

I still run into .cgi files every now and then. In some instances, I actually prefer the simplicity of a .cgi script to other options. Since I use DreamWeaver extensively, what I needed was a way to open .cgi scripts in Dreamweaver. And I wanted to …
This article is very specific and is only intended to help if you are installing Dreamweaver 8 in a Windows 7 environment with Office 2007 installed.   I'm not sure why Microsoft tends to release OS' that should not be released but they do.  Windows…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Edureka is one of the fastest growing and most effective online learning sites.  We are here to help you succeed.

911 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now