JavaScript for Form (using CGI formmail) that sends user a copy ofthe form data

Discussion in 'Javascript' started by TPK, Aug 26, 2010.

  1. TPK

    TPK Guest

    I have a form that collects field data, validates the data and sends
    it (on submit) to a specific email address and to a text file. This is
    done through a CGI form mail program. The form works well for this,
    but I’d like to add some functionality using JavaScript.

    The functionality I’d like to have is:
    When the form submits, and email is sent to the specific email, I’d
    also like the same email sent to the person submitting the form.

    One of the fields on the form contains the email address of the person
    filling out the form(senderEmail).
    I’d like to have the value of that field (the sender’s email address)
    incorporated in the onClick event so that when the user/sender clicks
    the submit button the action that takes place sends e-mail to:
    1) the “recipient”
    2) the text file
    3) the “sender”

    Here is a shortened version of the form:

    <form action="/cgi-bin/formmail.pl" name="MyForm" method="POST">
    <input type="hidden" name="recipient" value="">
    <input type="Text" name="senderName">
    <input type="text" name="senderEmaill" >
    <input type="submit" value="submit" onClick="onClick();return true;">
    <input type="reset" value="reset" name="reset">
    </form>

    Can someone show me a Javascript I can use (and how to use it in the
    form) that would accomplish this?

    Thank You,
    TPK
     
    TPK, Aug 26, 2010
    #1
    1. Advertising

  2. TPK

    Tim Slattery Guest

    Re: JavaScript for Form (using CGI formmail) that sends user a copy of the form data

    TPK <> wrote:

    >I have a form that collects field data, validates the data and sends
    >it (on submit) to a specific email address and to a text file. This is
    >done through a CGI form mail program. The form works well for this,
    >but I’d like to add some functionality using JavaScript.
    >
    >The functionality I’d like to have is:
    >When the form submits, and email is sent to the specific email, I’d
    >also like the same email sent to the person submitting the form.
    >
    >One of the fields on the form contains the email address of the person
    >filling out the form(senderEmail).
    >I’d like to have the value of that field (the sender’s email address)
    >incorporated in the onClick event so that when the user/sender clicks
    >the submit button the action that takes place sends e-mail to:
    >1) the “recipient”
    >2) the text file
    >3) the “sender”
    >
    >Here is a shortened version of the form:
    >
    ><form action="/cgi-bin/formmail.pl" name="MyForm" method="POST">
    ><input type="hidden" name="recipient" value="">
    ><input type="Text" name="senderName">
    ><input type="text" name="senderEmaill" >
    ><input type="submit" value="submit" onClick="onClick();return true;">
    ><input type="reset" value="reset" name="reset">
    ></form>
    >
    >Can someone show me a Javascript I can use (and how to use it in the
    >form) that would accomplish this?


    You won't find any way to do this client side. You'll have to do it
    server-side. If you have access to the CGI program, making it send
    this additional email should be easy.

    --
    Tim Slattery

    http://members.cox.net/slatteryt
     
    Tim Slattery, Aug 27, 2010
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. PC Leung
    Replies:
    0
    Views:
    775
    PC Leung
    Aug 10, 2004
  2. arsir walker

    Who sends me a copy of c function manual

    arsir walker, Jan 13, 2008, in forum: C Programming
    Replies:
    4
    Views:
    297
    Nick Keighley
    Jan 13, 2008
  3. Replies:
    1
    Views:
    109
  4. bhabs
    Replies:
    2
    Views:
    397
    Tad J McClellan
    Feb 13, 2008
  5. Alexandre Damiron
    Replies:
    0
    Views:
    150
    Alexandre Damiron
    Nov 29, 2005
Loading...

Share This Page