submit form, validate form, set cookie, send email, download file

Discussion in 'Javascript' started by mhawkins19@adelphia.net, Mar 16, 2005.

  1. Guest

    I have a form built and on the onclick event I validate all of the
    fields and then if the form is ok, on the submit event I run a
    javascript function to set a cookie and download a file from the
    current window.

    I have a cgi script provided by my web host to send the contents of the
    form through email but they only show me how to use the cgi script to
    send email through the submit event of the form.

    ie. <form name="downloadform" method="post"
    action="/cgi-bin/cgiemail/mailtemp.txt" onSubmit="return
    Validate(this)">

    Can I utilize the cgi script/link from my javascript function and still
    send the contents of the form through the cgi email??

    Thanks.
     
    , Mar 16, 2005
    #1
    1. Advertising

  2. Randell D. Guest

    Re: submit form, validate form, set cookie, send email, downloadfile

    wrote:

    > I have a form built and on the onclick event I validate all of the
    > fields and then if the form is ok, on the submit event I run a
    > javascript function to set a cookie and download a file from the
    > current window.
    >
    > I have a cgi script provided by my web host to send the contents of the
    > form through email but they only show me how to use the cgi script to
    > send email through the submit event of the form.
    >
    > ie. <form name="downloadform" method="post"
    > action="/cgi-bin/cgiemail/mailtemp.txt" onSubmit="return
    > Validate(this)">
    >
    > Can I utilize the cgi script/link from my javascript function and still
    > send the contents of the form through the cgi email??
    >
    > Thanks.
    >


    Javascript is (mostly) client side - your cgi is server side - so the
    short answer to your question is No... however... that does not mean
    that you cannot do what you want to do... It all depends on the cgi
    script on the server and what it is designed to do. If the server
    script is designed to be passed a "to" address and message text, but if
    its not expecting a file (assuming you want to send the file via email)
    then you're out of luck - The limitation is not javascript as it does
    not do the physical sending... your cgi does that bit...

    Chances are your cgi is written in Perl or PHP... if you have access to
    the source of it, I would suggest you ask someone in either of those two
    newsgroups to help you out... you'll have more luck there...

    I hope that helps,
    randelld
     
    Randell D., Mar 17, 2005
    #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. Replies:
    5
    Views:
    602
    Aaron Watters
    May 2, 2008
  2. Xeno Campanoli
    Replies:
    2
    Views:
    169
    Xeno Campanoli
    Jul 10, 2008
  3. Phil Powell
    Replies:
    2
    Views:
    217
    Grant Wagner
    Sep 5, 2003
  4. Replies:
    13
    Views:
    529
    Randy Webb
    May 14, 2006
  5. Replies:
    3
    Views:
    751
Loading...

Share This Page