View Single Post
  #1 (permalink)  
Old Sep 20th, 2005, 01:08
newbie44 newbie44 is offline
Junior Member
Join Date: Sep 2005
Location: Canada
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
help with formatting this javascirpt text...please!

I found this script, and it kind of does what I want..., I was able to add some other fields and they work. but in the email everything is on one line (like name, email etc). I'd like to have each field info have a line break. And I cannot get it to email the selection in the drop down box. Do you have any idea on this fixes? Thanks.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head><script name="JavaScript">

function SendEmail()
{
var toaddy = 'send2me@me.com';
var subject = 'JS Form Submission';
var mailer = 'mailto:' + toaddy + '?subject=' + subject + '&body=' +
'Name%20%20%20is\n\t' + document.jsform.visitorname.value + '\n\n' +
'Email%20%20%20is\n\t' + document.jsform.email.value + '\n\n' +
'Address%20%20%20is\n\t' + document.jsform.address.value + '\n\n' +
'Select%20%20%20is\n\t' + document.jsform.select.value + '\n\n' +
'Message:\n\n' + document.jsform.message.value +
'\n\n';
parent.location = mailer;
} // -->
</script>

<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body><form name="jsform">
<table id="address"><tr>
<td align="right">Name:</td>
<td><input name="visitorname" size="27"></td>
</tr><tr>
<td align="right">Email:</td>
<td><input name="email" size="27"></td>
</tr>
<tr>
<td align="right">Address</td>
<td><input name="address" type="text" maxlength="30"></td>
</tr>
<tr>
<td colspan="2">



<select name="select">
<option>Please select document</option>
<option>S request form</option>
<option>certificate</option>
<option>hello doc</option>
</select>
</p>


Your message:

<textarea name="message" cols="31" rows="6" wrap="soft">
</textarea>
</p>
<center>



<input type="submit" onClick="SendEmail()" value="Send Message">
</center></td>
</tr></table>
</form>document.jsform.NAME.value (replacing NAME with the form field's name)


</body>
</html>
Reply With Quote