Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Posts
    271
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Script Modify Question

    I wanted to use this script BUT I need to add under body. I have tried but something always errors. COuld someone please add just one more field called passenger so I can see how it was done . I am tring to send the body of a web page invoice this seems to fill the bill unless there is something better

    Thxs Steve


    <script>
    function doIt()
    {
    var S=document.exf2.subject.value;
    var B=document.exf2.body.value;
    self.location="mailto:someone@somewhere.com?subject="+S+"&body="+B;
    }
    </script>


    </head>
    <body>
    <form name=exf2>
    SUBJECT:<input type=text name=subject value="the subject"><BR>
    BODY:<input type=text name=body value="the body"><BR>
    <input type=button value="SUBMIT" onclick="doIt()">
    </form>
    </body>
    </html>

  • #2
    Regular Coder martin_narg's Avatar
    Join Date
    Jul 2002
    Location
    Chamonix, France
    Posts
    600
    Thanks
    1
    Thanked 3 Times in 3 Posts
    Code:
    <script>
    function doIt()
    {
    var S=document.exf2.subject.value;
    var B=document.exf2.body.value;
    var P=document.exf2.passenger.value;
    self.location="mailto:someone@somewhere.com?subject="+S+"&body="+B+"\n\nPassenger:"+P;
    }
    </script>
    
    
    </head>
    <body>
    <form name=exf2>
    SUBJECT:<input type=text name=subject value="the subject"><BR>
    PASSENGER:<input type="text" name="passenger"><br>
    BODY:<input type=text name=body value="the body"><BR>
    <input type=button value="SUBMIT" onclick="doIt()">
    </form>
    </body>
    </html>
    Is this what you are looking for mate? Hope this helps.

    m_n
    "Cos it's strange isn't it. You stand in the middle of a library and go 'Aaaaaaaaaaaaaaaaggggggghhhhhhh!'
    and everybody just stares at you. But you do the same in an aeroplane, and everybody joins in."
    -Tommy Cooper

  • #3
    Senior Coder nikkiH's Avatar
    Join Date
    Jun 2005
    Location
    Near Chicago, IL, USA
    Posts
    1,973
    Thanks
    1
    Thanked 32 Times in 31 Posts
    There are so many problems with using mailto for form submission, I can't list them here.

    Use a server-side form mail solution.

    See here for more, including a list of free services. Google will show even more, I'm sure.

    If this post contains any code, I may or may not have tested it. It's probably just example code, so no getting knickers in a bunch over a typo, OK? If it doesn't have basic error checking in it, such as object detection or checking if objects are null before using them, put that in there. I'm giving examples, not typing up your whole app for you. You run code at your own risk.
    Bored? Visit
    http://www.kaelisspace.com/


  •  

    Posting Permissions

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