SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Oct 2003
    Location
    St. Louis, MO
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Angry Forms results to new email message!!!!

    Please HELP!!!

    I am trying to place form results into a new email message. I need the textbox values to be placed veritcally in the email. I can't seem to figure out how to add a carriage return to the end of each value. I am very new with JavaScript......

    THanks!

    here is what i have so far....

    HTML Code
    --------------------------------------------------------------------------------

    <html>
    <head>
    <TITLE>ASP101</TITLE>
    <script>
    function doIt()
    {

    var S=document.exf2.subject.value;
    var B=document.exf2.txtSubmitted.value+
    document.exf2.txtRoom.value+
    document.exf2.txtBed.value+
    document.exf2.txtProblem.value;
    self.location="mailto:email@address.com?subject="+S+"&body="+B;
    }
    </script>
    </head>
    <body background="images/tile-metallic.jpg" bgproperties="fixed">
    <HR>
    <form name=exf2>
    <p align="left">
    <b>
    <font color="#FF0000">
    SUBJECT/font> <select size="1" name="subject">
    <option selected>Select Department</option>
    <option value="Mike Collins">I.T.</option>
    <option value="Paul McAllister">Maintenance</option>
    </select></b>
    <p align="left">
    <b>
    <font color="#FF0000">
    BODY/font></b>
    </p>
    <p align="left">
    <b><font face="Arial" size="3">Submitted by/font></b> <input type="text" name="txtSubmitted" size="20">
    </p>
    <p align="left">
    <b>Room: </b> <input type="text" name="txtRoom" size="20">
    </p>
    <p align="left">
    <b>Bed type/b> <input type="text" name="txtBed" size="20">
    </p>
    <p align="left"><b>Problem/b>
    </p>
    <p align="left">
    <textarea name="txtProblem" cols="50" rows="3" value=></textarea>
    </p>
    <p align="left">
    <BR>
    <input type=button value="SUBMIT EMAIL" onclick="doIt()">
    </p>
    </form>
    <HR>
    </body>
    </html>

  2. #2
    SitePoint Zealot
    Join Date
    Nov 2002
    Location
    Belgium
    Posts
    147
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    insert \n where you want it to have a carriage return. it can also be \r\n, depending on what your email client uses...


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
  •