Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Submit Button

Status
Not open for further replies.

NoBrakes

Programmer
Dec 5, 2001
3
US
I have written a Perl CGI script that produces a form and then emails me when the form is filled out with the information.
It works great except for one thing. on the initial load of the page it sends me a blank email?! I am trying to use the onClick => function() value in the submit button which works great after the initial page load. But for some reason the first pass generates what the script thinks is a click on the submit button.
I was just wondering if anyone had any experience with onClick and had a workaround for this problem? I know I could do some param() checking and probably stop this but would like to avoid that if I could. Any comments would be appreciated [bigears]
 
Why not use the standard HTML tag?
<INPUT TYPE=&quot;submit&quot; value=&quot;Send&quot;>

It is simple and does the trick.... When in doubt, deny all terms and defnitions.
 
Can we look at the code. I seems that you have an order of operation error going on. I first guess I would say that the program is set to receive the input variables and send them to you via email. Do you have a stop measure in place to prevent the email being sent if no variables are received.

Something like this:
The first line will execute if the $receivevar is null.
if (!($receivedvar)){
print qq(html form data);}
esle {emailme the stuff}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top