PDA

View Full Version : email "enter" key code


Cris79
03-05-2003, 10:56 AM
I have a html page with an email script like this:
=====================
<html>
<head>
<title></title>
</head>
<body>
<font FACE="ARIEL,HELVETICA" SIZE="-1"><p align="center">
<script LANGUAGE="JavaScript">
<!--//hide
function formatFields()
{
finalMessage= document.processor.elements[0].value
+ "; e-mail: " + document.processor.elements[1].value
+ "; Comments: " + document.processor.elements[2].value

document.sender.elements[0].value = finalMessage;
document.sender.action="mailto:icecris79@hotmail.com"+'?subject= Ola'+'';
}

function clearFields()
{
document.processor.elements[1].value = "";
document.processor.elements[2].value = "";
}
// -->
</script>
</font>
<form NAME="processor" METHOD="post">
<p>Your name:<br>
<input type="text" NAME="na"></p>
<p>Your e-mail:<br>
<input type="text" NAME="em"></p>
<P>Comments:<br>
<textarea name="comm" ROWS="5" COLS="20"></textarea></p>
</form>
<form NAME="sender" METHOD="post" ENCTYPE="text/plain" onSubmit="return formatFields();">
<input type="hidden" name="name" value><p><input TYPE="submit" VALUE="Send"> <input
TYPE="reset" VALUE="Clear" onClick="clearFields();"></font></p>
</form>
</body>
</html>
=====================

The e-mail sent is on one line :(
What is the code for "ENTER" key in JS? :rolleyes:
I want to put this after document.processor.elements[0].value
Thanks !!!

head8k
03-05-2003, 12:24 PM
try \r\n to force a new line

Cris79
03-05-2003, 02:50 PM
thanks a lot. Is working now.:thumbsup: