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.
|
|
|
|
|
![]() |
||
help with formatting this javascirpt text...please!
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
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> |
|
|
|
|||
|
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. |
![]() |
| Tags |
| help, formatting, javascirpt, textplease |
| Thread Tools | |
|
|
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 |