Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash








Help With Form Validation, Phone Number


here is a code below, would anyone help me validate a valid phone number? something like 555-555-5555, or numbers, or anything? right now i have it validate for empty space but little more specific would be nice, thank

__________________________________________________ _______________
fscommand ("allowscale", "false");
fname1.tabIndex = 1;
lname1.tabIndex = 2;
telno1.tabIndex = 3;
email1.tabIndex = 4;
address1.tabIndex = 5;
city1.tabIndex = 6;
state1.tabIndex = 7;
zip1.tabIndex = 8;
pdate1.tabIndex = 9;
ptime1.tabIndex = 10;
ftime1.tabIndex = 11;
passengers1.tabIndex = 12;
comments1.tabIndex = 13;
mailform = "mailform.php";
confirm = "please wait for confirmation ..."
action = "send";
Selection.setFocus("fname");
function validate (address) {
if (address.length>=7) {
if (address.indexOf("@")>0) {
if ((address.indexOf("@")+2)<address.lastIndexOf(".") ) {
if (address.lastIndexOf(".")<(address.length-2)) {
return (true);
}
}
}
}
return (false);
}
function formcheck () {
if ((((email == null)) || (email.length<1)) || (email == "ERROR! Address not valid")) {
email = "ERROR! Address not valid";
action = "";
}
if (!validate(email)) {
email = "Address not valid";
action = "";
}
if ((((fname == null)) || (fname.length<1)) || (fname == "ERROR! Address not valid")) {
fname = "First name required";
action = "";
}
if ((((lname == null)) || (lname.length<1)) || (lname == "ERROR! Address not valid")) {
lname = "Last name required";
action = "";
}
if ((((telno == null)) || (telno.length<1)) || (telno == "ERROR! Address not valid")) {
telno = "Phone # required";
action = "";
}
if ((validate(email)) && (email != "ERROR!") && (fname != "") && (lname != "")) {
action = "send";
loadVariablesNum (mailform, 0, "POST");
gotoAndPlay ("wait");
}
}
stop ();

__________________________________________________ _____________




FlashKit > Flash Help > Flash ActionScript
Posted on: 01-22-2008, 03:57 PM


View Complete Forum Thread with Replies

Sponsored Links:

Phone Number Validation
Howdy...

I need some help on validating the right form of the phone number...

I have most of the aspects validated and I got into some problems that I cannot solve myself...

1. I am using textfield.restrict = "0-9-"; to restrict the alphabetic characters entered to the text field, and it works fine when I publish the HTML and check it on the web. However, I cannot use any keys like Backspace or Delete keys to erase character within the Flash... Any way I can achieve both???

2. The final format of the phone number will be '123-456-7890'. I have a onEnterFrame handler that checks if the current character length is 3 or 7 to add '-' so that the user do not need to press '-' key... It works fine when I enter the number one by one, but, say, if I hold the '1' longer to get '111-111-1111', I get '111111111111' because it just took the advantage of onEnterFrame handler... Any help on this anybody???

I have attached the FLA file in case you need to take a look...

Thank you for your time...

View Replies !    View Related
Phone Number And Zip Validation
Hey again,

Does anyone have any idea how to validate a US phone number and zip code?
Help apprectiated, as always

View Replies !    View Related
Phone Number And Zip Validation
Hey again,

Does anyone have any idea how to validate a US phone number and zip code?
Help apprectiated, as always

View Replies !    View Related
Phone Number Validation, IndexOf
Hello,

I need some help with validating a phone number. I want to check if the length of the number is ten chars and if the first number is a "0" and the second number a "6".

This is my code so far.

Code:
form.send.onRelease = function() {
yournumber = form.number.text;
if (yournumber == null || yournumber == ""){
trace ("no number");
}
if (yournumber.length !=10|| yournumber.indexOf("0") == -1 || yournumber.indexOf("6") == -1) {
trace ("non existent number");
}
}
This only checks if there is a "0" and a "6", but not if they are the first and second char in the string.

Thanks for your help!

Jerryj.

View Replies !    View Related
Formatting A Phone Number, Round II
Hey,
i'd like to have a text field auto-format a phone number by inserting parenthesis around the area code and putting a dash between the areaCode-prefix-suffix...
I'm sure that i can create a function to do this by making conditional statements within an onChanged function, but my trouble is this.. how can i add characters to a certain index in a dynamic textbox, or is this even possible?

thanks,
-myk
the says....."mmmmMOOOOOOOOOOOOOOOOoooooooooo"

View Replies !    View Related
Putting A - Auto In Phone Number?
Hello,

I have a number 8966969
I would like to use actionscript to make it 896-6969

Any help please????????

Thannks

View Replies !    View Related
Backspace In Phone Number Textfield
I have a text field that when numbers are entered they format to look like a standard telephone number (XXX)XXX-XXXX using the following code.

_root.txt2.onChanged = function() {
var phonevar = this.text;
if (txt2.length == 3) {
var temp = "("+this.text+")";
this.text = temp;
Selection.setSelection(txt2.length+1, txt2.length+1);
} else if (txt2.length == 8) {
this.text += "-";
Selection.setSelection(txt2.length+1, txt2.length+1);
}
}

I'm having a problem when the user goes to backspace.. once they get to where the dash or parenthesis is inserted it won't let them delete anymore of the text.

Can anyone help me with this problem?

View Replies !    View Related
Backspace In Phone Number Textfield
I have a text field that when numbers are entered they format to look like a standard telephone number (XXX)XXX-XXXX using the following code.

_root.txt2.onChanged = function() {
var phonevar = this.text;
if (txt2.length == 3) {
var temp = "("+this.text+")";
this.text = temp;
Selection.setSelection(txt2.length+1, txt2.length+1);
} else if (txt2.length == 8) {
this.text += "-";
Selection.setSelection(txt2.length+1, txt2.length+1);
}
}

I'm having a problem when the user goes to backspace.. once they get to where the dash or parenthesis is inserted it won't let them delete anymore of the text.

Can anyone help me with this problem?

View Replies !    View Related
Explode Phone Number (Python)
Wahoo! I wrote my first python script that does something. It extracts a phone number out of a string… and divides it up into an array.


Code:
def extract_phone_number(number):
phone_number = ''
for index in range(len(number)):
if number[index].isdigit():
phone_number += number[index]

return [[phone_number.zfill(12)[-12:-10]],
[phone_number.zfill(12)[-10:-7]],
[phone_number[-7:-4]],
[phone_number[-4:None]]]
Use it like this…


Code:
extract_phone_number("512-555-3012")
extract_phone_number("11 512 555 3012")
extract_phone_number("5553012")
Anybody that knows python: Am I doing this right, or am I missing something obvious?

View Replies !    View Related
Mod-10 Number Validation Algorithm (modulo 10)
HI!
I'm looking for a Mod-10 (modulo 10) validation algorithm writen in actionscript.
From a text-field, the user will enter a code and on submit, actionscript will validate if the number is right.
Does anyone know this algorithm ?
Thanks.

View Replies !    View Related
Help With Form Validation
I have an actionscript it looks like this ....below.
How can I check for if there is an "@" or not ?

on (press) {
validname = "0";
validcompany = "0";
validaddress = "0";
validcity = "0";
validstaate = "0";
validcountry = "0";
validemail = "0";
validcomments = "0";

if (Number(length(name))>=1) {
validname = "10";
} else {
message = "*";
}


if (Number(length(company))>=1) {
validname = "10";
} else {
message = "*";
}


if (Number(length(address))>=1) {
validname = "10";
} else {
message = "*";
}


if (Number(length(city))>=1) {
validname = "10";
} else {
message = "*";
}


if (Number(length(staate))>=1) {
validname = "10";
} else {
message = "*";
}


if (Number(length(country))>=1) {
validname = "10";
} else {
message = "*";
}


if (Number(length(email))>=1) {
validemail = "10";
} else {
mailmessage = "*";
}


if (Number(length(comments))>=1) {
validcomments = "10";
} else {
message = "*";
}
}
on (release) {
if (Number(validname) == 10
and Number(validecompany) == 10
and Number(valideaddress) == 10
and Number(validecity) == 10
and Number(validestaate) == 10
and Number(validecountry) == 10
and Number(validemail) == 10
and Number(validcomments) == 10) {

message = "All fields completed correctly";
loadVariablesNum ("http://www.mydomain.com/cgi-bin/ezformml.cgi", 0, "POST");
}
}


Thank you

View Replies !    View Related
Form Validation
Gotta a problem,
how can I validate a form that the user could't use strange chars in text fields ?
Is there any way to exclude chars like : ? # % & " ! etc...?

thx in advance

Pedro Garcia

View Replies !    View Related
Form Validation
I would just like to be able to make sure that the user fills in every field. It doesn't really need email address checking or any other fancy stuff.
This script is in a loop on the timeline and gets read every 10 frames(I am dynamically updating the order total with this loop),

if (first_name == "" or last_name == "" or address == "" or city == "" or state == "" or zip == "" or country == "" or email == "" or payop == "") {
validate==no;
} else {
validate==yes;
}

Then:

on (release) {
if (validate==no) {
allfields.gotoAndPlay(2);
}
if (validate==yes) {
gotoAnPlay("confirm", 1);
}
}

On the submit button.
When all those fields are filled in, the variable won't change to "yes".
Any help would be greatly appreciated )

View Replies !    View Related
Form Validation
I wish to add some sort of validation to a form, so that there are no unexpected characters in names and that email addresses contain @ and at least one .
Can I write a function or subroutine to do this? I have never used functions before and I am a little unsure how to do this. I have a few fields on the form so I guess this will save repeating code???

Help


Thanks

View Replies !    View Related
Form Validation
Im trying to integrate flash with javascript using the javascript kit in dreamweaver. So far I'm not having much luck. The movie containing the form is loaded into a main movie on level 3. Can this movie get to the javascript contained in the HTML file needed to validate the form?

Thanks

Brian

View Replies !    View Related
Form Validation
Any idea how to check if a user input field/variable called email contains the characters @ and .

?

View Replies !    View Related
Form Validation
I made a flash website that has a contact form on it. I was wondering if anyone knows how I could check the 'email' field to see if it is a valid email address (eg. me @here.com). I don't know the scripting so that it checks for 'something@something.something'. How do I define the something in actionscript?

Thanks in advance,

Felix.

View Replies !    View Related
Form Validation
I have created a Flash Form in Flash MX. The form has various fields: name, address, email, telephone, etc. that pass to an email after the user clicks on the Submit button. I want to do one of two things:

1. I want to add some code so that after the user adds the 9 number telphone number that it automatically formats to (504) 123-4455 or 504-333-3333. So it would be after the user tabbs or moves off of the telephone text field, the number would automatically format.

- OR -
2. Or I just want to add some validation code to my submit button to check that the user has entered the proper format, either (504) 123-4455 or 504-333-3333.

Thanks, any help would be appreciated, I am really just an intermediate newbie.

View Replies !    View Related
Form Validation
I searched and found a few items kinda like my problem but not quite.

Ok I have 4 form elements that will be sent to a PHP script to email. All of the form elements are contained in one movie clip "form_mc"

I have a button that is a movie clip to send that has this code in it.

What its supposed to do is, when you enter the items correctly it will go to a frame (33) and say its sent successfully (and send the info to the mailform.php page. if its not entered correctly it will go to frame (31) and tell you it didnt.

code:
//this just fades in text on the button when rollover
//it works fine.
on(rollOver)
{
setProperty (this.glowtext, _alpha, "100");
}
on(rollOut)
{
setProperty (this.glowtext, _alpha, "35");
}

//Here is where I have problems
on(release)
{
if (_root.form_mc.name_txt.text != "")
{
_root.gotoAndPlay(33);
}
else
{
_root.gotoAndPlay(31);
}
}


For now I am just trying to get *just one* form item to work. If I can get that to work then the rest will be easy. The form item is input text and the instance is properly named "name_txt."

What happens is when I go to submit it always goes to frame 33 regardless of whether or not the name_txt has anything in it.

I have tried a couple of tutorials but they all seemed to have pretty much the same idea as what I have.

Any help would be greatly appreciated.

EDIT: Added [ as ] tags - jbum

View Replies !    View Related
Form Validation
I've tried a million differnt things on this already.
I have a submit button that will send three items of text data. Each text field needs to be filled in so I want to clarify there is text in the field before sent.
Currently I am using:
on (release){
if (fname.length)
warning = "more";
}

fname is the variable of required info. warning is the dynamic text field that will let the user know they need to fill the info out. It is not working though. What am I missing?

View Replies !    View Related
Form Validation Help
I posted this once last week without a reply and tried again this week without a reply as well.

im using flash mx pro or flash 7.0.2

hopefully its just a case of not putting it in the right forum area.

follow this link for the details and help me solve this madness

http://www.flashkit.com/board/showth...hreadid=629228

View Replies !    View Related
[F8] Form Validation Help
I have a simple input form to send to email. The mailto method will work fine. But I'm having a problem getting the field validation to work. Just wondering if I could get some help.


ronhvb

View Replies !    View Related
Form Validation
Hi,

I have made a personal info form on a page of a site I am doing as a project. As I am nub in actionscript, I don't Know how to validate Phone number text input field that will only except numbers.
Can anyone help me please...I am running out of time for my project submission...

View Replies !    View Related
[F8] AS Form / Validation Help
Hi

I have a form in flash with Combo Boxes and Input texts (compontents).

Below is the relevant part of the script. The bit I'm having problems with is the validating number part. When you enter an invalid ID number the message displays in theReel.text INVALID ID, but it still goes through as successfull. I tried to correct this by adding in the || theRodreg.text == "INVALID ID" || part to the following if statement, but this doesn't work either. Does anyone have any ideas?

Thanks



Code:
sender.onRelease = function() {

alphaString = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
var s:String = theReelreg.text;

if (s.length != 5 || Number(s.substring(0, 4))>5816 || Number(s.substring(0, 4))<1815 || alphaString.indexOf(s.substring(4))<0) {
theReelreg.text = "INVALID ID";
};

if (theDate.text == "" || theSname.text == "" || theReelreg.text == "INVALID ID" || theRodreg.text == "INVALID ID" ||theScountry.text == "" || theFname.text == "" || theLname.text == "" || theDateofbirth.text == "" || theStreet.text == "" || theHnumber.text == "" || theCounty.text == "" || thePostcode.text == "" || theCountry.text == "" || my_cb.text == "SELECT REEL" || my_cb2.text == "SELECT ROD" || my_cb4.text == "SELECT ONE") {
msgText.text = "REQUIRED FIELDS NOT COMPLETED";

};


if (theEmail.text.indexOf("@") == -1 || theEmail.text.indexOf(".") == -1) {
theEmail.text = "ENTER VALID EMAIL ADDRESS";


} else {
msgText.text = "";
senderLoad.theDate = theDate.text;
senderLoad.theReelreg = theReelreg.text;
senderLoad.theSname = theSname.text;
senderLoad.theScountry = theScountry.text;
senderLoad.theFname = theFname.text;
senderLoad.theLname = theLname.text;
senderLoad.theDateofbirth = theDateofbirth.text;
senderLoad.theEmail = theEmail.text;
senderLoad.theStreet = theStreet.text;
senderLoad.theHnumber = theHnumber.text;
senderLoad.theCity = theCity.text;
senderLoad.theCounty = theCounty.text;
senderLoad.thePostcode = thePostcode.text;
senderLoad.theCountry = theCountry.text;
senderLoad.theAdults = theAdults.text;
senderLoad.theChildren = theChildren.text;
senderLoad.theReel = my_cb.text;
senderLoad.theGender = my_cb3.text;
senderLoad.theMarital = my_cb4.text;
senderLoad.theEmployment = my_cb5.text;
senderLoad.theFishing = my_cb6.text;
senderLoad.theWhere = my_cb7.text;
senderLoad.theAssociation = my_cb8.text;
senderLoad.sendAndLoad("reel-reg.php",receiveLoad);

}
};


receiveLoad.onLoad = function() {
if (this.sentOk) {
gotoAndPlay("success");
}
};

View Replies !    View Related
[F8] Form Validation
I created a form with input text boxes and check boxes. Everything was fine until I added validation functions. It is like the validation function works, but then if you correct the error it still shows as an error and prevent to move on to the next page. If you fill the form right the first time, then its ok and you can move on...
if someone would see the problem in this code:

Code:
var textFields:Number = 0
var textError:String = "*"

function validateTextField() {

errors_txt.text = "";

if (name_txt.text.length < 2 || isNaN(name_txt.text) == false) {
errors_txt.text = ("Some Informations are Missing or Incorrect");
name_txt.text = textError + name_txt.text;
name_txt.setTextFormat(formatter);
}else{
name_txt.text = "" + name_txt.text;
} else {
textFields = 1;}
};


var checkBoxes:Number = 0;

function validateCheckBoxes () {
checkBoxError_txt.text = "";

if (terms_cb.selected) {
checkBoxes += 1;
} else {
checkBoxError_txt.text = "All Boxes Must be Checked to Continue"
}
if (how_cb.selected) {
checkBoxes += 1;
} else {
checkBoxError_txt.text = "All Boxes Must be Checked to Continue"
}
if (accurate_cb.selected) {
checkBoxes += 1;
} else {
checkBoxError_txt.text = "All Boxes Must be Checked to Continue"
}
};

function goToConfirmation () {
if (checkBoxes == 3 && textFields ==1) {
_root.grid_mc.gotoAndStop(26);
} else {
test_txt.text = "AHHHHHHHH";
}
}



function validateForm() {

//formatter.color = 0x412472;
validateTextField();
validateCheckBoxes();
goToConfirmation();

}

submit1_btn.onRelease = validateForm;
thanks in advance... I am desperate

View Replies !    View Related
Form Validation Help...
I'm creating a short submit form...I'm trying to validate the text fields.

Here is the error I am getting:


Quote:




ReferenceError: Error #1069: Property indexOf not found on flash.text.TextField and there is no default value.
at contact_fla::content_mc_1/sendActions()




I get that on this piece of code:


ActionScript Code:
...

else if(this.contactForm_mc.email_txt.length == "" ||
this.contactForm_mc.email_txt.indexOf("@") == -1 ||
this.contactForm_mc.email_txt.indexOf(".") == -1)
{
     this.contactForm_mc.status_txt.text = "Please enter a valid email address."
}

...

I'm using yellowDart's thread here and he says it works perfectly...I don't see what I'm missing...

View Replies !    View Related
Form Validation
Can someone please tell me why this validation won't work in vers 5?

function Send() {
if (_root.firstname == '') {
loadMovie("fname-error.swf", 1);
stop();
} else if (_root.lastname == '') {
loadMovie("lname-error.swf", 1);
stop();
} else if (isNan(day_telephone)) {
loadMovie("phone-error.swf", 1);
stop();
} else if (_root.email == '' || _root.email.indexOf('.', 0) == -1 || _root.email.indexOf('@', 0) == -1) {
loadMovie("email-error.swf", 1);
stop();
} else if (_root.maxrent == '') {
loadMovie("rent-error.swf", 1);
stop();
} else if (_root.bedrooms == '') {
loadMovie("bedrooms-error.swf", 1);
stop();
} else if (_root.movedate == '') {
loadMovie("date-error.swf", 1);
stop();
} else if (_root.myVar<1) {
loadMovie("check-error.swf", 1);
stop();
} else {
getURL("http://www.xxxxxxxx.com/", "_parent", "POST");
}
}

View Replies !    View Related
Form Validation
I have a simple flash form, which has some required fields, ie. name, addy, etc.

What I want to do, is validate that the fields have been filled before they can hit the "next" button.

I've searched the forum, but found nothing, so I appologize if this has been asked before.

As you know, my AS understanding is intermediate at best, but I don't think this is beyond my capabilities.

thanks in advance, this will score big with the PM...

Rev

View Replies !    View Related
Form Validation
Hi guys, I've a problem, I've a form in flash, built with Input Text Fields, my Variables are:

Nombres
Apellidos
Empresa
Telefono
Email
Ciudad
Comentarios

and I want to validate all the fields before somebody submits the button, how I can do this?

thanks!

View Replies !    View Related
Form Validation...
hi (again), I finally found a tutorial on how to get a form with checkboxes to work--but, I'm trying to make it where all the feilds have to be filled out before you can submit it. I just don't know what to put in this area.

here is the code--the problem is down at the bottom---

mc=this;
tfA=["company", "contact", "address", "city", "state", "zip", "phone", "email", "addinfo"];
cbA=["individual", "group", "medicare", "prescription", "life", "annuities", "longterm"];
submit_btn.onPress=function(){
lv=new LoadVars();
for(var i=0;i<tfA.length;i++){
lv[tfA[i]]=mc[tfA[i]].text;
}
for(var j=0;j<cbA.length;j++){
lv[cbA[j]]=mc[cbA[j]].selected;
}
lv.sendAndLoad("email_request1.php",lv,"POST");
}

submit_btn.onRelease = function(){
//I just don't know what to put after the if statment, I tried just the instance
names-no luck.
if ( ""){
_root.gotoAndPlay("error");
} else {
_root.gotoAndPlay("correct");
}
}

any suggestions?

thanks,
hutch

View Replies !    View Related
AS Form / Validation Help
Hi

I have a form in flash with Combo Boxes and Input texts (compontents).

Below is the relevant part of the script. The bit I'm having problems with is the validating number part. When you enter an invalid ID number the message displays in theReel.text INVALID ID, but it still goes through as successfull. I tried to correct this by adding in the || theRodreg.text == "INVALID ID" || part to the following if statement, but this doesn't work either. Does anyone have any ideas?

Thanks



Code:
sender.onRelease = function() {

alphaString = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
var s:String = theReelreg.text;

if (s.length != 5 || Number(s.substring(0, 4))>5816 || Number(s.substring(0, 4))<1815 || alphaString.indexOf(s.substring(4))<0) {
theReelreg.text = "INVALID ID";
};

if (theDate.text == "" || theSname.text == "" || theReelreg.text == "INVALID ID" || theRodreg.text == "INVALID ID" ||theScountry.text == "" || theFname.text == "" || theLname.text == "" || theDateofbirth.text == "" || theStreet.text == "" || theHnumber.text == "" || theCounty.text == "" || thePostcode.text == "" || theCountry.text == "" || my_cb.text == "SELECT REEL" || my_cb2.text == "SELECT ROD" || my_cb4.text == "SELECT ONE") {
msgText.text = "REQUIRED FIELDS NOT COMPLETED";

};


if (theEmail.text.indexOf("@") == -1 || theEmail.text.indexOf(".") == -1) {
theEmail.text = "ENTER VALID EMAIL ADDRESS";


} else {
msgText.text = "";
senderLoad.theDate = theDate.text;
senderLoad.theReelreg = theReelreg.text;
senderLoad.theSname = theSname.text;
senderLoad.theScountry = theScountry.text;
senderLoad.theFname = theFname.text;
senderLoad.theLname = theLname.text;
senderLoad.theDateofbirth = theDateofbirth.text;
senderLoad.theEmail = theEmail.text;
senderLoad.theStreet = theStreet.text;
senderLoad.theHnumber = theHnumber.text;
senderLoad.theCity = theCity.text;
senderLoad.theCounty = theCounty.text;
senderLoad.thePostcode = thePostcode.text;
senderLoad.theCountry = theCountry.text;
senderLoad.theAdults = theAdults.text;
senderLoad.theChildren = theChildren.text;
senderLoad.theReel = my_cb.text;
senderLoad.theGender = my_cb3.text;
senderLoad.theMarital = my_cb4.text;
senderLoad.theEmployment = my_cb5.text;
senderLoad.theFishing = my_cb6.text;
senderLoad.theWhere = my_cb7.text;
senderLoad.theAssociation = my_cb8.text;
senderLoad.sendAndLoad("reel-reg.php",receiveLoad);

}
};


receiveLoad.onLoad = function() {
if (this.sentOk) {
gotoAndPlay("success");
}
};

View Replies !    View Related
Form Validation
Hi there!
I've prepared a form in Flash and I was wondering whether it's possible to check whether the required fields have been filled before the form is submitted...Here's something I tried but it's not really working properly. Any help would be really appreciated

View Replies !    View Related
Need Some Form Validation Help
Can someone give me a quick and short email validation script? I'm almost braindead after staring at code for 5 hours.
Big thanks!!!

View Replies !    View Related
Form Validation
I got a problem. My form Validation isn't working. Actually to be more accurate, the chEmail function works but I also need Flash to check the input fields "first" and "last" to make sure something is entered in there? Am I missing something here or done something wrong? Thanks peeps

Here's the code related to the validation

function ckName(){
if (formData.first == ""){
errBox.setMessage("Oop's, you forgot to fill in your first name");
return false; }
else {
return true};
}

function ckName(){
if (formData.last == ""){
errBox.setMessage("Oop's, you forgot to fill in your last name");
return false; }
else {
return true};
}

function ckEmail(){
if(formData.submit_by == ""){
errBox.setMessage("You Must Fill In Your Email Address");
return false;}
else{
if(formData.submit_by.indexOf(".",0)==-1 || formData.submit_by.indexOf("@",0)==-1){
errBox.setMessage("Your Email Address Is Not In Correct Form");
return false;}
else{
return true;}
}

}

View Replies !    View Related
Form Validation Not Quite Right?
Hi People,

I'm in the process of testing this flash email form:
http://www.tees.me.uk/booknew
NOTE: enter '27' in the 'Go To page ' text field and click go to be able to view the form.
Once you are viewing the form if you click send without entering any text/data into any field it allows you to send a blank submission. It should send you to a failure screen and tell you to start again, I can't figure out where it is going wrong??

The actionscript is as follows... (I've highlighted the area I think is causing the issue.



stop();

var senderLoad:LoadVars = new LoadVars();
var receiveLoad:LoadVars = new LoadVars();

// Adds conditional logic for the Submit button that
// validates user input.

this.send_BU.onRelease = function(){
if (emailInput.text ==""){
_root.demoForm.gotoAndStop("failed");
} else {
_root.demoForm.gotoAndStop("success");
}
}

sendBU.onRelease = function() {
senderLoad.nameInput = nameInput.text;
senderLoad.emailInput = emailInput.text;
senderLoad.companyInput = companyInput.text;
senderLoad.contacttelInput = contacttelInput.text;
senderLoad.countyCOMBO = countyCOMBO.value;
senderLoad.sendAndLoad("http://www.tees.me.uk/BookNew/send.php",receiveLoad);
}

receiveLoad.onLoad = function() {
if(this.sentOk) {
_root.demoForm.gotoAndStop("success");
}
else {
_root.demoForm.gotoAndStop("failed");
}
}



PHP code is as follows:
<?PHP
$to = "myemail@address.com";
$subject = "Online Flip Book Demo Request";
$message = "Name: " . $nameInput;
$message .= "
Email: " . $emailInput;
$message .= "
Company: " . $companyInput;
$message .= "
Telephone: " . $contacttelInput;
$message .= "
Location: " . $countyCOMBO;
$headers = "From: $emailInput" . "
";
$headers .= "Reply-To: $emailInput" . "
";
$headers .= 'Bcc: myemail@address.com. "
";
$sentOk = mail($to,$subject,$message,$headers);
echo "sentOk=" . $sentOk;
?>

View Replies !    View Related
Form Validation
I have a simple flash form, which has some required fields, ie. name, addy, etc.

What I want to do, is validate that the fields have been filled before they can hit the "next" button.

I've searched the forum, but found nothing, so I appologize if this has been asked before.

As you know, my AS understanding is intermediate at best, but I don't think this is beyond my capabilities.

thanks in advance, this will score big with the PM...

Rev

View Replies !    View Related
Form Validation
Hi guys, I've a problem, I've a form in flash, built with Input Text Fields, my Variables are:

Nombres
Apellidos
Empresa
Telefono
Email
Ciudad
Comentarios

and I want to validate all the fields before somebody submits the button, how I can do this?

thanks!

View Replies !    View Related
Form Validation
Hi, does anyone know how to validate flash textfields using an external javascript function before sending the data to the server? Or perhaps actionscript within the .swf can accomplish this. If anyone knows a good tutorial or simply has some actionscript I can customize, that would be great.

thanks,
ryan

View Replies !    View Related
Form Validation
Is there a simple way to make a field in a flash form a "required" field. A property I can easily check to see if a text field has any information in it?

View Replies !    View Related
Form Validation
Hi
I'm currently doing an ActionScript Mini Task assignment. We have to create a form in action script, like a mini e-commerce thing, nothing big or special or fully working, just to work with forms.

I can't find any tutorials anywhere on how to validate forms.
I need to validate my email address, so it only goes any further if it finds a @ and a .

I also have payment detail text fields where I need to set the maximum amount of characters.

This is my code for one of the text fields I want to set maximum characters to:

Code:

////////////////////
//CREATE CARD SECURITY NUMBER TEXT FIELD
////////////////////
Form.createTextField("secNum_txt", 12, 322, 245, 40, 20);
Form.secNum_txt.type = "input";
Form.secNum_txt.border = true;
Form.secNum_txt.text = "";
Form.secNum_txt.setTextFormat(FormFormat);


and this is the code for my e-mail address text field, which is the same really.

Code:

////////////////////
//CREATE E-MAIL TEXT FIELD
////////////////////
Form.createTextField("emailAddress", 3, xPos, 240, 160, 20);
Form.emailAddress.type = "input";
Form.emailAddress.border = true;
Form.emailAddress.text = "E-Mail";
Form.emailAddress.setTextFormat(FormFormat);


Then I have the 'next' button which onRelease stores all the data entered into variables, to display in dynamic text fields on the next frame. I know the email validation code should go into a function in this button, so this is the code I have for the button.

Code:

////////////////////
//next button places text from input forms in dynamic text fields on the ORDER Page.
////////////////////
next_Butt.onRelease = function() {
   fName = Form.foreName.text;
   sName = Form.surName.text;
   email = Form.emailAddress.text;
   sAddress = Form.streetAddress.text;
   dAddress = Form.districtAddress.text;
   tAddress = Form.townAddress.text;
   pAddress = Form.postcodeAddress.text;
   typeOfCard = Form.cardCombo.getSelectedItem();
   cardNum1 = Form.cardNum1_txt.text;
   cardNum2 = Form.cardNum2_txt.text;
   cardNum3 = Form.cardNum3_txt.text;
   cardNum4 = Form.cardNum4_txt.text;
   secNum = Form.secNum_txt.text;
   sDate = Form.startDate_txt.text;
   eDate = Form.expireDate_txt.text;
   gotoAndStop("Order");
};


Thanks in advance for any help
Gavin

View Replies !    View Related
Flash Form Validation?
Is there a way to validate forms before sending them to my cgi program? I also need to make sure the user enters in a email address (its a required field).

thanks.

View Replies !    View Related
Form Data Validation
I think i've bitten off more than i can chew here.....
i've created a form in flash and have attempted to use the FDK from macromedia ta validate the input data... i've followed the tutorial but when tested on "Sumit" i get a javascript error and the browser attempts to load the Get URL parameters from actionscript and not validate the form....the Dreamweaver components appear to be simple!!

Any one got any ideas please?

Chris

View Replies !    View Related
Form Validation With Flash 5
I've created a working mail form with the loadvariables action. I need to be able to check if the user correctly fills in the input fields. I know there are javascript files to do this when making a form mail in HTML. Can someone help me with this in Flash 5?
Thanks

Kevin

View Replies !    View Related
Form Validation Questions
I am using Flash MX and need to do age validation. Does anyone have an example or know where I can find a good example of how to do age validation in a form in flash?

View Replies !    View Related
Form Validation Problem...
I've got my flash form validation down pat, but I recently noticed that a few entries were coming through with null values...
After testing my scipts again, I soon worked out that the only way to create a null value is to press the space bar in each entry, except for the email, where you can just enter "@."

here's my code, in case you were wondering...

on (release) {
if (!web.length || web == "") {
_root.EmailStatus = "Please enter the name of the website";
} else if (!weburl.length || weburl == "") {
_root.EmailStatus = "Please enter the URL";
} else if (!webdesc.length || webdesc == "") {
_root.EmailStatus = "Please briefly describe the website";
} else if (!name.length || name == "") {
_root.EmailStatus = "Please enter your name";
} else if (!email.length || email.indexOf("@") == -1 || email.indexOf(".") == -1) {
_root.EmailStatus = "Please enter a valid E-mail address";
} else {
loadVariablesNum("linkage.php", "0", "POST");
_root.EmailStatus = "Sending...";
}
}

Can anyone suggest a way I could trim the blank space from the entry so that people actally have to enter real values?

View Replies !    View Related
AS1: Form Validation Question
I am validating a form to make sure they are entering a first name, last name and email address.

You can see the example here:
www.kilgoretrout.net/index11.swf You will find the form on the contact page.

My problem is that the checks for first name and last name are not happening. Email address check seems to work fine. Can you tell me whats wrong?

Code:
function handleForm() {
first = Cmc.Cslide.Firstname.text;
last = Cmc.Cslide.Lastname.text;
test = Cmc.Cslide.Email.text;
if (first == undefined){
_root.submitInfo = "First name is required";
Cmc.Cslide.submitMsg.gotoAndPlay(2);
break;
}else if (last == undefined){
_root.submitInfo = "Last name is required";
Cmc.Cslide.submitMsg.gotoAndPlay(2);
break;
}else if (test.indexOf("@") == -1) {
_root.submitInfo = "A valid email address is required";
Cmc.Cslide.submitMsg.gotoAndPlay(2);
break;
}else if (test.indexOf(".") == -1) {
_root.submitInfo = "A valid email address is required";
Cmc.Cslide.submitMsg.gotoAndPlay(2);
break;
}else{
mailinglistVars.Firstname = Cmc.Cslide.Firstname.text;
mailinglistVars.Lastname = Cmc.Cslide.Lastname.text;
mailinglistVars.Address1 = Cmc.Cslide.Address1.text;
mailinglistVars.Address2 = Cmc.Cslide.Address2.text;
mailinglistVars.City = Cmc.Cslide.City.text;
mailinglistVars.State = Cmc.Cslide.State.text;
mailinglistVars.Zip = Cmc.Cslide.Zip.text;
mailinglistVars.Email = Cmc.Cslide.Email.text;
sendandgetData(4);
_root.submitInfo = "Thank you, your information has been sent";
Cmc.Cslide.submitMsg.gotoAndPlay(2);
Cmc.Cslide.Firstname.text = "";
Cmc.Cslide.Lastname.text = "";
Cmc.Cslide.Address1.text = "";
Cmc.Cslide.Address2.text = "";
Cmc.Cslide.City.text = "";
Cmc.Cslide.State.text = "";
Cmc.Cslide.Zip.text = "";
Cmc.Cslide.Email.text = "";
}
}
Thanks,
John Ziebro________
Multimedia Director
www.cogneato.com

View Replies !    View Related
Email Form Validation
I have this code in my email flash file and its working ok.

But i want to make sure that nobody with mail domains online.no or frisurf.no can register their mail adress in the input text field "domene" and i wan to have a message saying so if they try to register it.

The input text field "domene" only returns a mesage when its "null"

if (domene == null) {
domene = "Må fylles ut";
action = "";
}

Hope somebody can help me with this!?

Cheers
Retro...


-----------------Code------------------------------------

//
// validate email function
//
function validate (address) {
if (address.length>=5) {
if (address.indexOf("@")>0) {
if ((address.indexOf("@")+2)<address.lastIndexOf(".") ) {
if (address.lastIndexOf(".")<(address.length-2)) {
return (true);
}
}
}
}
return (false);
}
//
// form check
//
function formcheck () {
if ((((email == null)) || (email.length<1)) || (email == "Adressen er ikke gyldig")) {
email = "Adressen er ikke gyldig";
action = "";
}
if (!validate(email)) {
email = "Adressen er ikke gyldig";
action = "";
}
if (fname == null) {
fname = "Må fylles ut";
action = "";
}
if (lname == null) {
lname = "Må fylles ut";
action = "";
}
if (firma == null) {
firma = "Må fylles ut";
action = "";
}
if (org == null) {
org = "Må fylles ut";
action = "";
}
if (addy1 == null) {
addy1 = "Må fylles ut";
action = "";
}
if (zipp1 == null) {
zipp1 = "Må fylles ut";
action = "";
}
if (cityp1 == null) {
cityp1 = "Må fylles ut";
action = "";
}
if (ss == null) {
ss = "Må fylles ut";
action = "";
}
if (antall == null) {
antall = "Må fylles ut";
action = "";
}
if (domene == null) {
domene = "Må fylles ut";
action = "";
}
if ((validate(email)) && (email != "Feil!") && (fname != "") && (lname != "")) {
action = "send";
loadVariablesNum (mailform, 0, "POST");
gotoAndPlay ("wait");
}
}
stop ();

View Replies !    View Related
Form Validation In Flash - Please Help
i've created a simple form in flash that is hooked to a scrpit that handles the information but i wish for flash to validate some basic info before it is submitted to the script.
i tired using the "if" command but could not get it to work.
What is the action I need to put in in order to have it check if there's a "@" included in an email field for example ? I know the == command but what about "isf a certain symbol included i nthe field, Then ..." type of command ?

Thank you for your help
s.

View Replies !    View Related
Form Validation.. The Hard Way?
Code:
on (release) {
if (name == "") {
info = "Please enter your Name";
} else if (email == "") {
info = "Please enter an email address";
} else if (comments == "") {
info = "Comment box is empty";
} else info = "email is being sent";
}


okay so i have 3 text fields in a form
name, email and comments

and then a 4th to display the error and sent messages

so as it goes now once everything is filled out
the info text box reads: email is being sent once the form is submitted

basically i'd like a way for the next peice of script to work like this

Code:
if (info == "email is being sent") {
loadVariablesNum("form.asp", 1, "POST");
gotoAndPlay("sent");
}


the form will submit, but it does not wait for the info feild to say "email is being sent" is there a way to do this?

oh and all this script is contained in my submit button

thanks in advance

View Replies !    View Related
AS2 Form Validation & Processing
I'm looking for a good, meaty tutorial outlining best practices for validating user input forms - i don't need the backend submission stuff...just the UI & validation part.

View Replies !    View Related
Help With Form Script Validation
Greets,

I have made a form which I made my input texts say what needs to be entered. What I want is a script that will tell my results that they didn't enter their name.. here is my script for my send button


Code:
on (release) {
if (!email.length || email.indexOf("@") == -1 || email.indexOf(".") == -1) {
results = "Please check your e-mail address";
} else if (!name.length) {
results = "Please enter your name";
} else {
this.loadVariables("http://www.bridgeport-music.com/form/forms/process.php","POST");
results = "Sending Data...";
play();
}
}

So like I said my name input text comes up saying "Enter Your Name". If they do not enter their name that will still be sent. I want a script that will display "You did not enter your name" in my results if they do not change their name

View Replies !    View Related
Copyright © 2005-08 www.BigResource.com, All rights reserved