SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Hybrid View

  1. #1
    SitePoint Enthusiast
    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?

  2. #2
    I believe you have my stapler. scrubz's Avatar
    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();">

  3. #3
    SitePoint Enthusiast
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •