PDA

View Full Version : Flash Question


gigiloumill
10-07-2010, 04:45 PM
Guys, I am working on the code for a contact form in flash. I don't get any errors, but, I can't get the code to do certain things. The code shows the "thank you for inquiry" within the "status" box but it will not show when an e-mail, name or comments" are not input. Can someone please tell me what I'm doing wrong? Here's the code. ThanksbSubmit.onRelease = function()
{
email();
}
function email()
{

var sMessage = "Name: " + tName.text + "\nEmail: " + tEmail.text + "\nPhone: " + tPhone.text + "\nComments: " + tComments.text;
lvSend = new LoadVars();
lvReply = new LoadVars();
lvSend.msg = sMessage;
lvSend.address = "info@test.com";
tName.text = "";
tEmail.text = "";
tPhone.text = "";
tComments.text = "";

lvReply.onLoad()
status.text = "Sending Message...";
{
status.text = "Thank your for your inquiry.";
}
lvSend.sendAndLoad('send_mail.php', lvReply, 'POST');

}

function formValidationChecks(){
if ((!Email.text.length) || (Email.text.indexOf("@") == -1) || (Email.text.indexOf(".") == -1)) {
status.text = "Please enter a valid E-mail address";
return false;
} else if (!tName.text.length) {
status.text = "Please enter Your Name";
return false;
} else if (!tphone.text.length) {
status.text = "Please enter Your Telephone";
return false;
} else if (!tComments.text.length) {
status.text = "Please Enter Your Message";
return false;
}
return true;
}

gigiloumill
10-08-2010, 07:51 PM
wow, no flash peeps here...lol

edbr
10-09-2010, 01:12 AM
the validation is javascript no? did you not write that?

gigiloumill
10-09-2010, 02:47 AM
is flash..

edbr
10-09-2010, 03:45 AM
ok right. you may have a wait not so many members use actionscript for validation i think

edbr
10-09-2010, 05:04 AM
looking at it although i know nothing, i would say it was calling the email function on release but not the validation

bSubmit.onRelease = function()
{
email();
}

gigiloumill
10-09-2010, 11:53 AM
I know, I tried rewriting with this but, it only validates the email and name and then it stops...

bSubmit.onRelease = function()
{
if( formValidationChecks() == true) email();
}

gigiloumill
10-09-2010, 01:49 PM
Never mind e, I did it in a different form. Now it works perfect..Thanks

Corrosive
10-09-2010, 04:08 PM
wow, no flash peeps here...lol

Steve Jobs says we aren't allowed :(