Hookster264
In Runtime
- Messages
- 162
- Location
- Denver, CO
I created a basic form with basic text input fields named account, description, date, time, person, title, and contact.
I added a submit button that when clicked would launch my external javascript.
<input type="submit" name="sendEmail" value="Submit Ticket" onclick="SendEmail(this.form)" />
My javascript:
function SendEmail(frm){
var emailAddress="apersonemail@somewhere.com; apersonemail@somewherelese.com;"
var message = "Hello,"+ "\n";
message = message +"\nAlarm Account #: " + frm.account.value + "\n"
+ "\n" + frm.description.value + "\n"
+"\nDate Notified: " + frm.date.value + "\n"
+"Time Notified: " + frm.time.value + "\n"
+"\nNotifying Party: " + frm.person.value + "\n"
+"Title: " + frm.title.value +"\n"
+"Contact Information: " + frm.contact.value + "\n"
document.location.href = "mailto:"+emailAddress+"?subject="+frm.account.value+" Work Order Request "+frm.date.value+"&bcc=aperson@nothere.com&body="+escape(message);
}
When the submit button is clicked, an email is generated with email addresses populated, the body completed with the message var (to include the fields entered in the form: account, description, date, time, person and contact). Subject line is populated with form field values Account and date, separated by my own text of Work Order Request: "?subject="+frm.account.value+" Work Order Request "+frm.date.value+"
This is probably not the easiest or best way to do this, but it works for me.
I added a submit button that when clicked would launch my external javascript.
<input type="submit" name="sendEmail" value="Submit Ticket" onclick="SendEmail(this.form)" />
My javascript:
function SendEmail(frm){
var emailAddress="apersonemail@somewhere.com; apersonemail@somewherelese.com;"
var message = "Hello,"+ "\n";
message = message +"\nAlarm Account #: " + frm.account.value + "\n"
+ "\n" + frm.description.value + "\n"
+"\nDate Notified: " + frm.date.value + "\n"
+"Time Notified: " + frm.time.value + "\n"
+"\nNotifying Party: " + frm.person.value + "\n"
+"Title: " + frm.title.value +"\n"
+"Contact Information: " + frm.contact.value + "\n"
document.location.href = "mailto:"+emailAddress+"?subject="+frm.account.value+" Work Order Request "+frm.date.value+"&bcc=aperson@nothere.com&body="+escape(message);
}
When the submit button is clicked, an email is generated with email addresses populated, the body completed with the message var (to include the fields entered in the form: account, description, date, time, person and contact). Subject line is populated with form field values Account and date, separated by my own text of Work Order Request: "?subject="+frm.account.value+" Work Order Request "+frm.date.value+"
This is probably not the easiest or best way to do this, but it works for me.