Submit Your Article Webforumz RegistrationAnnouncements Contact Webforumz StaffContact
Home Resources Blogs Meet the Team Contact Register
 

Go Back   WebForumz.com > The Visual Design > Flash and ActionScript

Reply
 
LinkBack Thread Tools
Old July 31st, 2007, 03:43 PM   #1
New Member
 

Join Date: Apr 2007
Location: Market Harborough
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 papalazarou78 is on a distinguished road
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 = " abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWX
        YZ";
        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");
        }
};
papalazarou78 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Bookmarks

Tags
actionscript , form , validation


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Form validation help! psycho wolvesbane JavaScript 16 February 12th, 2008 12:40 PM
Form Validation cjrollo Flash and ActionScript 0 February 22nd, 2007 01:33 PM
Form Validation feebee JavaScript 1 August 3rd, 2006 12:12 PM
PHP Form Validation. kaz PHP 2 July 22nd, 2006 04:47 PM
PHP Form Validation ??? j4mes_bond25 PHP 2 May 31st, 2006 07:08 PM


Search Engine Optimization by vBSEO 3.2.0 RC8