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

M

mhawkins19

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.
 
R

Randell D.

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top