Welcome to WebmasterWorld Guest from

Forum Moderators: coopster & jatar k & phranque

Message Too Old, No Replies

Help would be appreciated with FormMail....

How to get the Submit button to do three things...

2:21 pm on Jul 28, 2003 (gmt 0)

Preferred Member

10+ Year Member

joined:Mar 1, 2003
votes: 0

Hi folks,

I've been banging my head on this for a couple of days now and I just can't figure it out. I'm not a coder - give me a screwdriver anyday - so I hope you can help in newbie-speak.

I have a contact page where all I require is a name, e-mail address, confirm e-mail address, and 6 numerical values of the users choice.

I need to confirm that the details in the 'e-mail addy' and the 'confirm e-mail addy' fields match before it is submitted. No problem there. I need the details to be e-mailed to me. No problem there. I need the submit button to take the user to the next page. No problem there.

But what is a problem is that I need the button to do all three things in one click. So in essence, when the user enters the details and clicks on the submit button, the details are checked (and a message alerts the user if there is incorrect info), an e-mail is sent to an address via my formmail script, and the user is taken to the next page.

I can do them all individually, but I have no idea how to call various functions from the one button.

The script that I have to check the data responds from an OnClick event from the submit button. That in turn checks the data and I can get the user to the next page by using a
window.location= 'nextpage.htm'. So that's effectively two actions in the one click - but when I do that, the OnClick function overrides the sending of the forms data to my Formmail script, and thus I don't get any data sent to me.

Does that make sense? Any ideas how I can do this?

Thanks for your time.


2:49 pm on July 28, 2003 (gmt 0)

Junior Member

10+ Year Member

joined:July 3, 2002
votes: 0

hi, just include the following into you cgi script:

$url = "your url";
print "Location: $url\n\n";

or check out

[hotscripts.com ]