This seems to be pretty basic but I cannot get it exactly the way I want it. Note: I have been looking for 4 days on how to resolve this.
Issue:
I created a form to be used on my work intranet (ie7 / Outlook) which will email the form textarea answers to the specified email address via Mailto (plain/text) and I want to add a carriage return after each text area on submit.
Reason:
This is for a staff quiz page (no access to php on this server so using mailto), and the text is too cramped when sent by the email. I want to add spacers between each question response.
What I have working:
This works but only on the textarea with ID = A1 and I have it as an onchange event. My form does not have a submit button (sent via another script) so I also not sure how to execure onSubmit.
[CODE]<SCRIPT LANGUAGE=JavaScript>
function DisplayEvent(eventName){
var myMessage = window.document.frm.a1.value;
myMessage = myMessage + eventName;
window.document.frm.a1.value = myMessage;
} </SCRIPT>
Much appreciate any help you can give.
Here is a stripped down example of my form (note: i added in the submit button for the example)
[CODE]<FORM NAME=”mailer” id=”frm” METHOD=”post” ACTION=”” ENCTYPE=”text/plain” onSubmit=”(document.mailer.action += mailtoandsubject)” >
To Mail:<input type=”text” NAME=”mailtoperson” onChange=”msg(this.form)” /><BR />
<INPUT TYPE=”hidden” SIZE=45 NAME=”Enter Quiz Title Here” onChange=”msg(this.form)” />
<INPUT TYPE=”hidden” SIZE=45 NAME=”subject” value=”Enter Quiz Title Here – hidden” onChange=”msg(this.form)” />
Q1: <textarea name=”1″ id=”styled” cols=”22″ rows=”5″></textarea><br/>
Q2: <textarea name=”2″ id=”styled” cols=”22″ rows=”5″ ></textarea><br/>
Q3: <textarea name=”3″ id=”styled” cols=”22″ rows=”5″ ></textarea><br/>
<input type=”submit”>
</form>
<script type=”text/javascript”>
function msg() {
document.mailer.action = “mailto:”
mailtoandsubject = ( ( document.mailer.mailtoperson.value) + ‘?subject=’ + document.mailer.subject.value );
}
</script>