SitePoint Sponsor |
|
User Tag List
Results 1 to 3 of 3
Thread: mailto form puzzler ???
-
May 17, 2001, 05:53 #1
- Join Date
- Feb 2001
- Location
- Dùn Éideann, Alba
- Posts
- 72
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I've got a mailto form on my website and it's using "text/plain" encoding. What I want to know, is it possible to add carriage returns before and after the sent field text?
If so, how would I go about doing it?
-
May 17, 2001, 07:04 #2
- Join Date
- Feb 2001
- Location
- Van down by the river
- Posts
- 254
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
If I understand you correctly, you want a carriage return before and after some text? You can do something like this:
<script language="JavaScript">
<!--
function addCarriage() {
var crTxt = "\r" + document.myForm.txtField.value + "\r";
document.myForm.txtField.value = crTxt;
}
// -->
</script>
And call the function when you submit the form:
<form name="myForm" method="post" action="blah.html" onSubmit="addCarriage();">
-
May 17, 2001, 07:58 #3
- Join Date
- Feb 2001
- Location
- Dùn Éideann, Alba
- Posts
- 72
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Thx Scrubz. Yeah, I thought it would be something like that byt my mind went blank.
I've got a major rush to get my new site finished for relaunch tomorrow. Consequently, my brain has dissolved.
Bookmarks