SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Enthusiast
    Join Date
    Nov 2000
    Location
    France
    Posts
    81
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Need to post a form to the sender through mailto(?). They fill in their email address among other details, and the form is emailed to them (for confirmation) and also to one other (as an order).
    Any help greatly appreciated! (My first time using this site)

  2. #2
    SitePoint Wizard TWTCommish's Avatar
    Join Date
    Aug 1999
    Location
    Pittsburgh, PA, USA
    Posts
    3,910
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Let me see if I have it straight:

    You want a form where the user enters their email - and collects other information (comments, name, etc)...and then emails a copy of this information both to an email address you specify, as well as the email they entered?

    BTW: sounds like this, for future reference, would be better placed in the "Server Side Scripting & Database Development" forum.

  3. #3
    SitePoint Member
    Join Date
    Sep 2000
    Posts
    23
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The best way to do this is via server-side scripting, this way you can have the variable/form fields that the user filled in and send an email to the client, plus send another email to where ever you want.

    I know how to do this in Coldfusion which is serverside, but for javascript I am not to sure.

  4. #4
    SitePoint Wizard TWTCommish's Avatar
    Join Date
    Aug 1999
    Location
    Pittsburgh, PA, USA
    Posts
    3,910
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    JavaScript can do lots of things, but I'm not sure if sending email is one of it's capabilities - could an expert like Vinny weigh in on this? I'd be curious to know if I'm missing something.

    But yes, Cold Fusion, Perl, PHP and ASP can all accomplish this without too much trouble. Odds are your host supports, at the very least, Perl.

  5. #5
    SitePoint Guru Vincent Puglia's Avatar
    Join Date
    Feb 2000
    Location
    where the World once stood
    Posts
    700
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    Presuming the address is in a field called 'email' and you are using a regular button with an onClick instead of a submit button:

    <form ...no action...>
    ....blahblha
    <input type='button' onClick='sendForm(this.form)'>
    </form>

    function sendForm(formObj)
    {
    var emailAdd = formObj.email.value;
    formObj.action = 'mailto:' + emailAdd;
    formObj.submit();
    }

    BTW: Happy Turkey Day

    Vinny
    Where the World Once Stood
    the blades of grass
    cut me still

  6. #6
    SitePoint Enthusiast
    Join Date
    Nov 2000
    Location
    France
    Posts
    81
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks Vincent - exactly what I needed! One question however - when I tap on the text fields it tends to treat it as a 'mailto' link, and opens my mail app instantaneously. How can I get around this, or have I done something wrong?

  7. #7
    SitePoint Guru Vincent Puglia's Avatar
    Join Date
    Feb 2000
    Location
    where the World once stood
    Posts
    700
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    Unfortunately, that is what 'mailto:' does. Also, if you are sending the form field values and/or message, you may have problems with some versions of Outlook/AOL mail program in that the form fields and other information will be dumped in the subject line.

    As everyone else above said, cgi may be better solution.

    Vinny
    Where the World Once Stood
    the blades of grass
    cut me still


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
  •