function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
jimjamzjimjamz 

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

Hi,

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!

regards

Jimmy



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

<body>
<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')">
</form>
</body>

--/html>

KingsleyKingsley
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.
jimjamzjimjamz
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.