473,226 Members | 1,405 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,226 software developers and data experts.

Re: How to insert text on multiple lines - in "body" of mailto:


"G. Morgan" <no***@il.invalidwrote in message
news:87********************************@mypost.inv alid...
<I don't have access to a server-side app. so this must be done client
side.>

How do I get:
(thebody)+(dropdown) to appear on their own lines in the resulting email?
<snap>
<script>
function now()
{
var thebody=document.testform.thebody.value;
var dropdown=document.testform.dropdown.value;
window.location.href="mailto:no*****@invalid.com?s ubject=Mail Test&body="
+
(thebody)+(dropdown);
}
</script>
<snap>
Did you try <cr><lf[chr(10) + chr(13) or other way around] combination?
** Posted from http://www.teranews.com **
Aug 10 '08 #1
2 5109
On Aug 10, 6:53 pm, G. Morgan <no...@il.invalidwrote:
GArlington wrote:
Did you try <cr><lf[chr(10) + chr(13) or other way around] combination?

No, how would I do that?

--
It takes a big man to cry,
but it takes a bigger man to laugh at that man. -Jack Handey

Take back Usenet <-->http://improve-usenet.org
<a href="mailto:bl**@blah.com?Subject=thisSubject&Bod y=The message's
first paragraph.%0ASecond paragraph.%0AThird Paragraph.">mailto</a>
Aug 12 '08 #2
GArlington wrote:

[...]
<a href="mailto:b...@blah.com?Subject=thisSubject&Bod y=The message's
first paragraph.%0ASecond paragraph.%0AThird Paragraph.">mailto</a>
An end-of-line character can only be written as %0D%0A here. RFC 2368:

| Also note that line breaks in the body of a message MUST be
| encoded with "%0D%0A".

The example stands a bit further:

| <mailto:in*****@example.com?body=send%20current-
| issue%0D%0Asend%20index>

Also, spaces are not allowed, they must be written as %20. Apostrophes
can be written as ' or %27, my preference goes to %27. The variables
'thebody' and 'dropdown' must be percent-encoded before they can be
used inside an URI.

All together:

----------------------------------------------------------

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Feedback Form</title>
<script type="text/javascript">
function now() {
var thebody = escape(document.testform.thebody.value);
var dropdown = escape(document.testform.dropdown.value);
window.location.href = "mailto:no*****@invalid.com?"
+ "subject=Mail%20Test&body="
+ thebody
+ '%0D%0A'
+ dropdown;
}
</script>
</head>
<body>
<form name="testform" method="get" action="#"
onSubmit="return false;">
<p>
<textarea name="thebody" rows="5" cols="30">This is test.</textarea>
<br>
<select size="1" name="dropdown">
<option value="yes">yes</option>
<option value="no">no</option>
</selectchoose yes or no.</p>
<p><input type="button" value="click me" onClick="now();"></p>
</form>
</body>
</html>

----------------------------------------------------------

To the original poster: I've altered your code so that it's now valid
HTML (4.01, transitional), please see validator.w3.org for details.
Also be careful for leading/trailing end-of-line characters inside
<textarea>. I removed them in any case.

Hope this helps,

--
Bart
Aug 12 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Gary N. | last post by:
Hi - I'm not sure if I've found a bug with the "splice" function or if I just need better documentation. Splice doesn't work quite how O'Reilly describes it (Javascript, 4th edition, Jan 2002,...
1
by: Shiperton Henethe | last post by:
Hi Anyone know how to do a MAILTO: such that the "BODY=" parameter contains carriage returns ? e.g. <A HREF="mailto:brochure@webwindows.co.uk?subject=Brochure Request&amp;body=Line1 blah blah...
16
by: TJO | last post by:
I am trying to pre populate an email body using javascript. I cannot figure out how to control the carraige returns for the text. The standard \r\n is not working. Is there another technique I...
4
by: Viken Karaguesian | last post by:
Hello all, I have a question. I trying to run two Javascripts on my webpage, both of which need a <body onload> command. They are as follows: <body onload="runMe()"> <body...
1
by: Chad Dittmer | last post by:
I'd appreciate anyone's help with this. I'm trying to open an email window and have it auto fill from vb.net. It works, except I can't get line breaks in the body. I've tried: vbLf vbCrLf...
15
by: cj | last post by:
How can I get a button in VB to send the contents of a text box via email in a manner similar to the "Send To\Mail Recipient" functionality that you can select via right clicking a file in Windows...
15
by: pbd22 | last post by:
Hi. I want to create a tab with a little "active tab" arrow below it to tell the user where they are. An example is here: http://personals.yahoo.com/us/search/dashboard Does anybody know of...
7
by: sheikh11 | last post by:
Dear sir, i would like to bring into your kind info dt i hve desires to embeb image or HTML in text body, & i hope that you will be me in this regard our coding are as below. Set JMail =...
10
by: Dan2kx | last post by:
Hello to all, i have a new interesting problem to solve.... i have a report that i would like to email to a list of users, the report is a full page document and is personalised to each user...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.