AS Form / Validation Help

This is a discussion on "AS Form / Validation Help" within the Flash & Multimedia Forum section. This forum, and the thread "AS Form / Validation Help are both part of the Design Your Website category.



Go Back   Webforumz.com > Main Forums > Design Your Website > Flash & Multimedia Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Jul 31st, 2007, 19:43
Junior Member
Join Date: Apr 2007
Location: Market Harborough
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
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: Select all
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");
        }
};
Reply With Quote

Reply

Tags
actionscript, form, validation

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 Forum 16 Feb 12th, 2008 16:40
Form Validation cjrollo Flash & Multimedia Forum 0 Feb 22nd, 2007 17:33
Form Validation feebee JavaScript Forum 1 Aug 3rd, 2006 16:12
PHP Form Validation. kaz PHP Forum 2 Jul 22nd, 2006 20:47
PHP Form Validation ??? j4mes_bond25 PHP Forum 2 May 31st, 2006 23:08


All times are GMT. The time now is 16:49.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43