Sooner or later you will face with the small quest of validating an email address for your flash application. The following script is a basic script and should not be used for websites that relay heavily on the email address is being requested (shopping carts, credit card transactions and so forth)
Actionscript:
-
function isValidEmail(e) {
-
if (e.indexOf("@") != -1 && ( e.indexOf(".")> e.indexOf("@") ) ){
-
trace("success");
-
}else{
-
trace("error");
-
}
-
}
-
-
//Test
-
isValidEmail("test@test.com");
June 11th, 2007 at 7:11 am
very good one but what if you got an email like me.u@gmail.com ?
it will return it false ...
any idea ?
August 14th, 2007 at 3:10 am
How about like this ???
if (e.indexOf("@") != -1 && ( e.lastIndexOf(".") > e.indexOf("@") ) ) {
trace("success");
}else{
trace("error");
}
August 14th, 2007 at 3:29 am
// a minimum a@a.us is require
if ((emailString.indexOf("@") > 0) &&
(emailString.lastIndexOf(".") > (emailString.indexOf("@") + 1)) &&
(emailString.lastIndexOf(".")
August 14th, 2007 at 3:40 am
// minimum a@a.us
if ((e.indexOf("@") > 0) &&
(e.lastIndexOf(".") > (e.indexOf("@") + 1)) &&
(e.lastIndexOf(".")
April 10th, 2008 at 1:16 am
Hello,
i want email validation with flash action script which i have
apply here the code :
validate_btn.onRelease = function() {
indexOfAt = email.text.indexOf("@");
lastIndexOfDot = email.text.lastIndexOf(".");
if (indexOfAt != -1 && lastIndexOfDot != -1) {
if (lastIndexOfDot
May 27th, 2008 at 9:43 am