A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: [F8] Make sure the form is complete?

  1. #1
    Senior Member jerryday's Avatar
    Join Date
    Mar 2002
    Posts
    154

    [F8] Make sure the form is complete?

    Hi,

    I am trying to make sure that all of the input boxes in a frame have something in them before I advance to the next frame.

    Unfortunatly my syntax is bad and what I have come up with may not even work if the syntax is fixed. Here is my script which is on the send bytton (I know I am bad. It should be in a function)

    Please take a look at this.

    Thanks!

    Code:
    on (press) {
    	
    	vhost1.stopSpeech();
    	
    	//try to be sure we have something in every box
    	if (accountNumber.text.length == 0)
    		gotoAndStop (177);
    		 else if (accountNumber.text.length == 0)
    		gotoAndStop (177);
    		 else (firstName.text.length == 0)
    		gotoAndStop (177);
    		 else if (lastName.text.length == 0)
    		gotoAndStop (177);
    		 else if (email.text.length == 0)
    		gotoAndStop (177);
    		 else if (tech.text.length == 0)
    		gotoAndStop (177);
    		 else if (locations.text.length == 0)
    		gotoAndStop (177);
    		 else if (supplier.text.length == 0)
    		gotoAndStop (177);
    		 else if (areaCode.text.length == 0)
    		gotoAndStop (177);
    		 else if (prefix.text.length == 0)
    		gotoAndStop (177);
    		 else if (phone.text.length == 0)
    		gotoAndStop (177);
    		 
    	
    	
    	
    	QuerySent = "";
    	gotoAndPlay(36);
    	
    	play();
    }
    – Jerry

  2. #2
    anyone else hear that? flashpipe1's Avatar
    Join Date
    Jan 2003
    Location
    Upstate NY
    Posts
    1,930
    A few different ways you could set this up...

    one way:
    Code:
    if ((accountNumber.text.length == 0) | (firstName.text.length == 0) | ...etc...) {
    	gotoAndStop(177);
    	//generally a better idea to use frame labels in case you insert/remove frames
    } else {
    	QuerySent = "";
    	gotoAndPlay(36);
    	play();
    }
    Hope that helps!
    Love like you've never been hurt, live like there's no tomorrow and dance like nobody's watching.

  3. #3
    Senior Member jerryday's Avatar
    Join Date
    Mar 2002
    Posts
    154
    Thanks! That worked out great.
    – Jerry

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center