help with formatting this javascirpt text...please!

This is a discussion on "help with formatting this javascirpt text...please!" within the JavaScript Forum section. This forum, and the thread "help with formatting this javascirpt text...please! are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > JavaScript Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Sep 20th, 2005, 01:08
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

  #2 (permalink)  
Old Sep 28th, 2005, 18:57
Banned Member
Join Date: Sep 2005
Posts: 51
Thanks: 0
Thanked 0 Times in 0 Posts
1. tu separate feelds, add carriag retern/line feed weer yu want..."%0D%0A"...thats the hex kode for ascii (13 & 10 in desimal).
sins its hex thats number zero (not letter 0)
2. for drop box...
num1 =document.inputf.selektname.selectedIndex;
this assume it is in a form with name=inputf
wons yu hav the number (1 up tu how many opshuns), yu kan get a value outta the select, or hard kode wot tu du. if num1 < 1, yuzer did not select NE-thang.
Reply With Quote
  #3 (permalink)  
Old Sep 29th, 2005, 14:08
Junior Member
Join Date: Sep 2005
Location: Canada
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
thnx for the tip

Thanks. I'll try it.
Reply With Quote
Reply

Tags
help, formatting, javascirpt, textplease

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Paragraph formatting when importing text from TXT or XML McAurthur19 Flash & Multimedia Forum 0 Mar 20th, 2007 19:12
text formatting questions Lchad Web Page Design 7 Jan 27th, 2007 23:05
Text formatting trouble BGarner Web Page Design 4 Jan 8th, 2007 11:47
formatting of text froma a dynamic table in dreamweaver chimp Databases 2 Jan 2nd, 2007 10:09
Formatting Text - XML newbie wants everything! AceTutor Other Programming Languages 0 Apr 28th, 2006 13:53


All times are GMT. The time now is 10:49.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43