Flasher Archive

[Previous] [Next] - [Index] [Thread Index] - [Previous in Thread] [Next in Thread]


Subject: Re: FLASH: How to validate forms in action script????
From: John Croteau
Date: Sun, 12 Dec 1999 15:28:40 GMT

Hi Daniel,

Brandon's number verifacation script works fine but does not work if the
number is a decimal (has a period in it), the script could be modified
to handle that. Please note these comments are based on the use American
style number notation.

In your case I would prepare the number before sending to the number
check script.
1) I would check to see if the entry was blank.
2) I would use the spaces Plug and Play -- TrimEnds. This would remove
spaces and prevent otherwise legal entries with a space at the beginning
or the end to be validated.
3) Then I would create a new Plug and Play for commas by changing
If (c eq " ") to If (c eq ",") in the RemoveAll spaces Plug and
Play.
This will remove all commas. For example it would change 1,000 to 1000
and then allow verififacation as a number.
It will also verify 10,10,10 as 101010, if this is a problem a more
complicated routine could be created.
http://www.FlashBible.com/Members/ActionScript/PlugNPlay/Strings.htm

`````````````````````````````````````````````````
> On (Press)
> Set Variable: "size" = length(userinput)
> Set Variable: "badInput" = false
> Set Variable: "loop1" = 1
> Loop While (loop1<=size and badInput=false)
> Set Variable: "loop2" = 0
> Set Variable: "isNumber" = false
> Loop While (loop2<=9 and isNumber=false)
> If (substring(userinput,loop1,1) eq loop2)
> Set Variable: "isNumber" = true
> End If
> Set Variable: "loop2" = loop2+1
> End Loop
> If (isNumber=false)
> Set Variable: "badInput" = true
> End If
> Set Variable: "loop1" = loop1+1
> End Loop
> If (badInput=true)
> Trace ("Not all numbers!")
> Else
> Trace ("All numbers!")
> End If
> End On

--
Coming Soon Flash 4 Web Animation F/X and Design
http://www.amazon.com/exec/obidos/ASIN/1576105555/flashcentral
----------- -----------------------
John Croteau croteauaterols [dot] com (mailto:croteauaterols [dot] com)
------------- -------------------------
FlashTek (Advanced Websites with Flash) http://www.FlashTek.com/
Flash Bible (Fast track to good Flash) http://www.FlashBible.com/
Flash Central(The Universe Starts Here) http://www.FlashCentral.com/
The Flash Tech Resource (Tech Notes) http://www.FlashCentral.com/tech/
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


flasher is generously supported by...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Streaming Media WEST '99 Conference & Exhibition
"The Worlds largest Internet Audio & Video Event"
December 7 - 9, San Jose Convention Center, California

Reserve your space today at http://www.streamingmedia.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe or change your list settings go to
http://www.chinwag.com/flasher or email helpatchinwag [dot] com


Replies
  RE: FLASH: How to validate forms in acti, Daniel Votino
  Re: FLASH: How to validate forms in acti, Branden Hall

[Previous] [Next] - [Index] [Thread Index] - [Next in Thread] [Previous in Thread]