471,603 Members | 1,480 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,603 software developers and data experts.

body onUnload with perl script

I have a shoping cart page wth a registration form.

The submit button takes them to GoogleCheckout.

I want to call my formmail.cgi with the <body unload=...> tag.

However, I get 2 error messages ater I click Submit

1) cgi is undefined
2) browser prompt me to open or save cgi file

Code is:
<body onUnload="cgi-bin/bformmail.cgi">

The perl script works if i call it with the action method in the form tag.

I could call it within a js function, then call that function with the action method before calling the GoogleCheckout code but...

I've searched for hours and cannot figure out how to do it.

(Do I have to tell the browser it's perl script and if so how?)

Any code snippets will be greatly appreciated!

JV
Nov 10 '07 #1
1 2181
numberwhun
3,503 Expert Mod 2GB
I have a shoping cart page wth a registration form.

The submit button takes them to GoogleCheckout.

I want to call my formmail.cgi with the <body unload=...> tag.

However, I get 2 error messages ater I click Submit

1) cgi is undefined
2) browser prompt me to open or save cgi file

Code is:
<body onUnload="cgi-bin/bformmail.cgi">

The perl script works if i call it with the action method in the form tag.

I could call it within a js function, then call that function with the action method before calling the GoogleCheckout code but...

I've searched for hours and cannot figure out how to do it.

(Do I have to tell the browser it's perl script and if so how?)

Any code snippets will be greatly appreciated!

JV
If you have a form, then the correct place to put it is in the form tag as you mentioned. The form is what would be processed, not the HTML body. When the submit button is clicked, then the form will kick off that script and submit its values to it.

Also, you have to make sure that CGI is enabled in the web server on the machine the script resides on, otherwise the script will be printed to the screen, most likely.

Regards,

Jeff
Nov 11 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by Brian Vallelunga | last post: by
10 posts views Thread by bbcrock | last post: by
2 posts views Thread by Oleg Ogurok | last post: by
3 posts views Thread by Sunny | last post: by
reply views Thread by MichaelMortimer | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.