Form To Mail Validation Problems!!!

allthat

Free Member
Oct 2, 2012
31
0
Hello, I have a problem that I hope can be solved.

I am messing around with a Form that is directed to my Email.

Now I have tried both of the below methods, but the message ALWAYS gets sent to my email regardless!

The Javascript functions do not pop up!

I've tried this:
<form method="post" action="thankyou.php" id="orderform"</form>

And this:
<form name="myForm" action="form2.php" onsubmit="return validateForm()" method="post">
First name: <input type="text" name="fname">
< input type="submit" value="Submit">
< /form>

Is this something to do with the onsubmit event?

Sorry to be so vague, but it's because I am a newbie, and I know that this is not strictly validation as such with Javascript, but I rather like the pop up box Error Warning things.

Proper validation can wait for a bit.

Thanks so much if you can help, or offer advise.
 
You need to provide a lot more information.

The normal form construction is

Code:
<form method="POST" action="dosomething.php">
....
</form>
This means when the user clicks submit they are taken to dosomething.php.

If you have a whole bunch of JS validation and there is a JS error then it may well be bypassed and you go straight to the 'send the email' scrirpt.

So I suspect the problem is the code you have on the page not the php that processess the form.
 
Upvote 0
Like fisicx says this is a bit vague but if you want the data to be sent to an alternative email address you need to look at whatever php file you are sending the form data to. e.g. "form2.php"
 
Upvote 0

Latest Articles