Form Validation

How do i validation fields in flash text fields, numeric, date, time and email.

numeric you would assign the text box value a variable (ie. Tbox) and then use this AS

    trace(Tbox+" - This is not a numeric value (ie. Not a Number - NaN)

as for date and time ive no idea… maybe use a for loop (as below) and check each character (again as below) but rather than checking against an array, check to see if it is a number (as above) and if it is not, then check it against an array to see if it is a colon for example…?

email is a bit more tricky… lets say your searching for the @ sign and a . after the @ somewhere…
use a loop to evaluate each character of the variable you have set equal to the text box (again using Tbox)

myArray = new Array("@",".") //sets up an array with the characters we want to check in the order we want to check them
x=0 //resets the validation index
for(i=0;i<Tbox.length;i++){ //sets up a loop
	if(Tbox.charAt(i)==myArray[x]){//checks the variable, character by character for the character defined in our array
		trace(myArray[x]+" is at the location: "+i) //tells you where the character in question is (optional)
		x++ //starts looking for the next character in our array
//the below is an optional output if the email is incorrect format
	trace("sorry, we did not recognise your email address as valid")

hope this has helped you a bit :wink: