Email from error frields

Hi Guys,

I have created an email from in flash and php, but i would like it to have error fields.

So if somebody doesn’t type a @ in the email field it will say

“Please provide a valid email address”

And the same type of idea for the Name and Comments filed.

But, I dont now how to do this. Would anybody be kind enough to help me?

Thanks in Advance

http://proto.layer51.com/d.aspx?f=78
http://proto.layer51.com/d.aspx?f=188
http://proto.layer51.com/d.aspx?f=688

http://nikke.letm.com/~nikke/dev/flash/formvalidator/

Hi Kax,

i appreciate the reply, But i would need help setting it up.

If i posted my Php and .Fla here, could you add them for me?

Ehmm… yeah, I guess I could do that… :whistle:

Hi Kax,

I would just like an error message to appear on the form if the user types nothing in at all, and if they dont type in an @ and . in the email field

So there is an error message for each field:

Please enter your name
Please enter a valid email address
and
Please leave some comments

Thanks

Here’s something quick… I have to go. :-
[AS]checkForm = function () {
var error;
if (!name_txt.length) {
name_txt.text = “Please enter your name”;
error = true;
}
if (!email_txt.length || email_txt.text.indexOf("@")<1 || email_txt.text.indexOf(".")<3) {
email_txt.text = “Please enter a valid email address”;
error = true;
}
if (!comments_txt.length) {
comments_txt.text = “Please leave some comments”;
error = true;
}
return !error;
};
form_btn.onRelease = function() {
if (checkForm()) {
mail_lv = new LoadVars();
mail_lv.msg = comments_txt.text;
mail_lv.name = name_txt.text;
mail_lv.email = email_txt.text;
mail_lv.send(“form.php”);
}
};[/AS]

Thanks alot Kax,

Much appreciated

You’re welcome. :wink:

Also, I dont suppose you could help me add a

“Sending Email…Please Wait”

and

“Email Sent”

Could you?

Done. :stuck_out_tongue:

Thanks again Kax,

But theres one more thing,

Could you explain how you did this?

As i would like to write a tutorial on how i created this form.

Regards

Also,

I just uploaded the form you modified, And when i press submit, I get Sending email please wait

And then it says Error

Even though i recieve the emai :crazy:

I just tested it on my server, it works fine for me. :wink:

And if you want to write a tutorial on how YOU created this form…
You can start here… http://www.kirupa.com/developer/actionscript/asandphp.htm

:stuck_out_tongue:

Hey Kax,

Heres my email form

Look at it, It doesn’t work :frowning:

Even though it still sends the emails

Craig :smiley:

I got a 404 error. :sigh:

****,

My servers down :frowning:

Do you have Msn or Aol?

Nope… I’m not a big fan of instant messaging.

Thats very wierd,

What are the reasons for it saying “Error” when the email sends?

Ok Kax,

The server is back up again now

Take a look at it