Including JS IN Email Template

Good evening fellow fabrikars!

I have a form that fires an html template and I have added some JS to identify what time of day it is. For example, when the email is received it says

Good Evening Mark Reynolds

etc etc

When I complete the form the JS is not working, doe sit get stripped out before submission?

If so, is it possible to have the JS stay in the form some way?

Thanks

Mark
 
Well, JS is obviously only ever run in the browser.

The only way you could get JS running in a form display to show in an email template, would be to assign the value your JS comes up with to a form input, and include it in your email template with a normal {table___element} placeholder.

Can you paste what your JS is doing here?

-- hugh
 
Thanks Hugh here you go

<script> day = new Date()
hr = day.getHours()
hr1 = hr - 12
if (hr < "6") {
document.write(" Good Morning ")
}else if (hr < "12"){
document.write(" Good Morning ")
}else if (hr < "13") {
document.write(" Good Afternoon ")
}else if (hr < "17") {
document.write(" Good Afternoon ")
}else if (hr < "22") {
document.write(" Good Evening ")
}else if (hr >= "22") {
document.write(" Good Evening ")
}
//--></script>


Sent via my iPhone using Tapatalk app so please excuse brevity and typing errors :)
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top