So I have been working on a project for a while and have been trying for days to get the form to work. Nothing is working and I have several questions. The form has 6 input text boxes (name, email, town, year, model, color)
every reference or tutorial has given me too many answers and nothing works. wish I could just have somebody write it for me so I can copy/paste or a step by step as most of the tutorial and guides are over my head.
So here are the questions.
1. Do the input text field need to be on a special layer with all ver name to each box. ( right now my layers are from top to bottom a. actions b. buttons c. elements d. backgrounds)
2. Do input fields need to be made into a movie.
3. The Submit button, does it need to be on the same layer as input text.
4. Is this the correct script for the button. I have a thank you message after you submit.
on (release) {
if (name eq "" or email eq "" or town eq "" or year eq "" or model eq "" or color eq "") {
stop();
} else {
loadVariablesNum("email3.php", 0, "POST");
gotoAndStop(2);
}
}
Can anybody help and tell me how to create and code this as im ready to throw my computer out the window im so frustrated.
When I did a test, the submit button was present but none of the input text boxes were even visible, could be a layer thing . . . just dont know.
I just got Flash CS3 so I might just install that and use a tutorial as it seems easier but I hate updating software in the middle of a project incase something goes wrong.
on (release) {
if (name.length < 1 or email.length < 1 or town.length < 1 or year.length < 1 or model.length < 1 color.length < 1 ) {
stop();
} else {
getURL("email3.php", _blank, "POST");
gotoAndStop(2);
}
}
This goes in "email3.php"...
PHP Code:
<?php $sendTo = "[email protected]"; $email = "<".$_POST['email'].">"; $subject = "Mega Meet Registration"; $msg = "Name: ".$_POST["name"]."\r\nEmail: ".$_POST["email"]."\r\nTown: ".$_POST["town"]."\r\nYear: ".$_POST["year"]."\r\nColor: ".$_POST["color"]."\r\n"; mail($sendTo, $subject, $msg, "From: ".$email); echo "Thank you. Your e-mail has been sent. You may now close this window."; ?>
The reason loadVariablesNum() doesn't work for this (as far as I know) is because the page isn't open, which is why getURL() should work, because it opens the window. If this doesn't work, let me know.
Total ActionScript Errors: 3 Reported Errors: 3
__________________________________________________ ____________
Does the form need to be in a movie clip, right now it is not.
What about a layer for it, I have a "FORM" layer below the ACTIONS layer and above the BUTTONS layer.
Sorry, missed a less than sign...these silly little things kill people every time.
Code:
on (release) {
if (name.length<1 or email.length<1 or town.length<1 or year.length<1 or model.length<1 or color.length<1) {
stop();
} else {
getURL("email3.php", _blank, "POST");
gotoAndStop(2);
}
}
I publish with the setting for HTML to be center alignment yet the page displays on the upper left corner. How do i make the site centered in the browser. I know it has to do with HTL but where.
Here is the HTML flash generated.
______________________________________________
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Index</title>
</head>
<body bgcolor="#ffffff">
<!--url's used in the movie-->
<!--text used in the movie-->
<!--
it first checks if all textfields are filled and the email address is correctly formed,
if correct, using LoadVars objects with php files, it checks to make sure
the email address textfield is not trying to send mail from a bogus email domain,
when all checks are correct, it mails the form details.
Ii can see how as the emails i received had from "XXXX"@panzo.websitewelcome.com" who is that?
I plugged in and altered the graphics but not the text or code of the file you sent "a mod dog" and it seems better and safer but when i posted and tested my email came back saying it was invalid????
Check out the site to see.
Also I tried to have the website center on the page and nothing works.
I added the line of html coed that sumwungye put in but nothing happens.
Also it seem your code works better as all me info for email gets called invalid but why does the "from" have "from: [email protected]"
as the from when I receive a email?
So i went back to sumwungye's code and all works well with center and everything yet when i hit the submit button a blank browser window appears, it used to say "your email has been sent" but i got rid of that line of code yet a "Blank" page is still popping up. I also got rid of the "_blank in the flash sumbit button but it still happens???
Well I used Sums code and the window is not coming up anymore . . .ya
I still dont know why the return emails say "[email protected]"
Seems like some shady stuff but i dont care anymore as I done more witrh stupid forms then I ever wanted. If people are getting there email address for a reason tuff . . . there are to many things to pay attention to in coding . . . it aint for me.