i've created a simple form in flash that is hooked to a scrpit that handles the information but i wish for flash to validate some basic info before it is submitted to the script. i tired using the "if" command but could not get it to work. What is the action I need to put in in order to have it check if there's a "@" included in an email field for example ? I know the == command but what about "isf a certain symbol included i nthe field, Then ..." type of command ? Thank you for your help s.
if(mailText.indexOf("@")<>-1){ // included @ ....... }else{ //no @ ...... }
thanks for your reply this is not working for me - maybe i am not changing the right parameters. the valiable i need to check is named "email" please advice thank u again .
if(email.indexOf("@")<>-1){ ........ what is type of the variable "email"?
it's an input text var. is that ok ?
I have tested in my computer,it's Ok. .......
It works - THANK YOU SO SO SO SO MUCH ! Peace s.
While we are here let me ask you tow more quick questions regarding this matter : How do i validate a var to include only numerals? and also how do i sting all of these validations together? I need something like if A does not include B the B=_______, and if X does not include y then X=___________ ( etc... ) - else >>>>>> .... thanks for your help. s.
It is an easy job, it can be done without ActionScript.Select the inputText, and look at the properties window, there is a button named "character", press it , and you can define what letters can be fill in the inputText. you can defined "1234567890", and users can not type any other letters in you inputText but Numbers.
Don't see what you're looking for? Try a search.
|