Hello,
I inherited a web form and I am trying to make some changes. I am fairly new to programming and thus to JavaScript, I have been trying to modify a script that opens outlook and fills out the recipient, subject and email body. the idea is that the user revises the email before ending.
What I would like to add is an if statement so send to specific users if a specific field is picked
Here is what I have tried so far
original code
Modified code
But this does not work, not sure where I am going wrong, any help is much appreciated!!
thanks!!
I inherited a web form and I am trying to make some changes. I am fairly new to programming and thus to JavaScript, I have been trying to modify a script that opens outlook and fills out the recipient, subject and email body. the idea is that the user revises the email before ending.
What I would like to add is an if statement so send to specific users if a specific field is picked
Here is what I have tried so far
original code
Code:
<script type=text/javascript>
function openoutlook()
{
var S=document.form.company.value;
var B=document.form.email.value;
var M=document.form.csupdatedby.value;
var A= <% = Cdbl((rsGuestbook("ID")))%>
var url = '[URL unfurl="true"]http://mydomain.com/xx/view.asp?id='[/URL] + escape(A);
self.location="mailto:mycustomlist@mydomain.com?subject=An New Entry Has Been Made To xx Form "+A+" by "+M+" &body= Here is the link to the updated project "+url;
}
</script>
Modified code
Code:
<script type=text/javascript>
function openoutlook()
{
var S=document.form.company.value;
var B=document.form.email.value;
var M=document.form.csupdatedby.value;
var A= <% = Cdbl((rsGuestbook("ID")))%>
var url = '[URL unfurl="true"]http://mydomain.com/xx/view.asp?id='[/URL] + escape(A);
if (csupdatedby == 'customer service') {
self.location="mailto:cs@mydomain.com?subject=An New Entry Has Been Made To xx Form "+A+" by "+M+" &body= Here is the link to the updated project "+url;}
else if (csupdatedby == 'production') {
self.location="mailto:production@mydomain.com?subject=An New Entry Has Been Made To xx Form "+A+" by "+M+" &body= Here is the link to the updated project "+url;}
else if (csupdatedby == 'QC') {
self.location="mailto:qc@mydomain.com?subject=An New Entry Has Been Made To xx Form "+A+" by "+M+" &body= Here is the link to the updated project "+url;}
else if (csupdatedby == 'Accounting') {
self.location="mailto:Accounting@mydomain.com?subject=An New Entry Has Been Made To xx Form "+A+" by "+M+" &body= Here is the link to the updated project "+url;}
}
</script>
But this does not work, not sure where I am going wrong, any help is much appreciated!!
thanks!!