-
hi,
i am trying to create a member code input.
some of the code should be letters, some numbers. i have managed to detect and test the letter inputs (using the Ord function). i need help to detect if the others are numbers.
can anyone please help before i tear out all of my hair?
------------------
cheers,
Rich.
-
My last mesage didn't display properly (it missed some action script - I tried to edit it but it looked OK?? Any problems here?
So I'm reposting
Here is one way.
The following if condition will be true when variable “input” contains a number and false for any other character
If (ord(input)>=ord("0") and ord(input)<=ord("9"))
The following will be false when variable "input" contains a number and true for any other character
If (ord(input)<ord("0") or (ord(input)>ord("9"))
There is an example in Flash’s help of the condition above - but Macromedia’s coding is more complex than required
Hope this helps,
Rich.
[This message has been edited by rich (edited 01 April 2000).]
-
For some reason the last if statement won't post correctly
Hopefully this works.
It should read :
If (ord(input)<ord("0") or (ord(input)>"9")
Mr Moderator,
Is there a problem somewhere. I've edited the message above this one and it looks OK in the edit message screen but the post doesn't contain the correct code.
Any suggestions?
Thanks,
Rich.
-
Grrr...
even the above didn't post correctly and I retyped the offending line.
-
cheers rich
If (ord(input)>=ord("0") and ord(input)<=ord("9")) ....works fine.
you have no idea how relieved i am!!!!!
thanks.
------------------
cheers,
Dodge.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|