Nicholas Diaz;1273531 wrote:to clarify. your problem is when the rep fills the form out you need to create the email script which grabs the selected managers email from a drop down which is selected by the rep?
if so to make it easy would it be possible to just add the managers email to the drop down box instead of the managers name> then when you pull in the form data just call on the id of the form field to the email header and save ur self a step. if u want to do it with php just create a variable for each managers name = to their email and then in the email script instead of adding an email just type the email variable and set an array showing each managers name is = to their email address.
I have attached the latest code that I have been working on. The managers email is what is in the actual code and that would work but I also need the requested branch and shipping branch to show up in my out like this example:
Stock Number: 12345
Serial Number: 67890
Description: equipment
Requested By: Jane
Requested Date: 06/20/2013
Customer Info: John Doe
Requesting Branch: jjones@gmail.com This should be Orlando
Shipping Branch: Boston this should email to jdoe@gmail.com
Code: This is just part of the code that I need to have an email go to the branch mgr and also provide me a request branch of Boston or Raleigh, etc.
<html>
<head>
<title>Multiple Option Attributes</title>
</head>
<body>
<form name="transferform" id = "transferform">
<p>
Requested Branch: <br>
<select name="requestbranch" id="requestbranch" onchange="rem1(this)">
<option selected value=""> Choose One</option>
<option value="Boston"> Boston </option>
<option value="Raleigh"> Raleigh </option>
<option value="Orlando"> Orlando </option>
<option value="Topeka">Topeka</option>
</select>
</form>
<script type = "text/javascript">
// Branch Array
var branch = [];
branch['Boston'] = ["Boston","jdoe@gmail.com"];
branch['Raleigh'] = ["Raleigh","bsmith@gmail.com"];
branch['Orlando'] = ["Orlando","jjones@gmail.com"]
branch['Topeka'] = ["Topeka","lbaker@gmail.com"]
function rem1(which) {
if (which.value !="") {
var ndx = document.transferform.requestbranch.selectedIndex;
var val = which.value; // .branch
var loc = branch[which.value][0]; // .location;
var email = branch[which.value][1]; // .email;
alert("Value "+ndx+": "+val+"\nRequesting Branch: "+loc+"\nEmail: "+email);
} else { alert('Requires selection'); }
}
</script>
******************* My attempt to send to email below************
<!--Code above works as an alert, now I need to get it to output to email showing Requesting Branch: Boston, etc. and to email properly to Branch Manager
<input LANGUAGE="JavaScript" TYPE="button" class="button" VALUE="Submit"
ONCLICK="location.href = "mailto:" +
document.transferForm.requestbranch.options[document.transferForm.requestbranch.selectedIndex].value + "; " +
"+ndx+": "+val+"\nRequesting Branch: "+loc+"\nEmail: "+email: NAME="Send email">-->
</body>
</html>