+ Start a Discussion

javascript doesn't execute in HTML-BASED email ??? please advise!


I'm still a JS beginner programmer and been killing me how this works!
Basically, i'm trying to collect response from external users via email, if they would like to attend a function or not.

I've tested the function below on IE and it works perfectly fine. The javascript function fires off when executed within a web page. It basically changes the member_status to 'accept' or 'declined'. This is the most important part which i want to get working.

The same function does not work when executed from a HTML BASED EMAIL. It will pass the original value 'Temp Value' back into SFA regardless of which button i click.

How do i get this to work?? If there are any html gurus please advise on another method or why this JS doesn't quite fire!



--script type="text/javascript">
function Attending(strField)
{document.getElementById("member_status").value = strField;
// document.getElementById("mainForm").submit()

<form id="mainForm" >
<input size="25" id="member_status" name="member_status" value="Temp Value">
<input type="button" value="Accept" onclick="Attending('Accepted')">
<input type="button" value="Decline" onclick="Attending('Declined')">


Most email clients (including recent versions of Outlook) will NOT execute Javascript in emails. This is because the Javascript would execute with the same access level as a local file, allowing it to do bad things to the user's computer.

You should rethink what you're trying to do here. Why not have 2 links with a status parameter? Javascript seems like overkill in this case.
ugh! why didn't i just think of that. doh! ;)

This whole thing is basically a glorified Web2Lead email instead of Web2Lead html page.

I've placed the paramater inside the button instead and it worked like a charm sending back to the Leads module in SFA

thanks Kingsley.