summaryrefslogtreecommitdiff
path: root/roundcubemail/program/js/common.js
diff options
context:
space:
mode:
authorroundcube <roundcube@208e9e7b-5314-0410-a742-e7e81cd9613c>2005-11-06 19:26:45 +0000
committerroundcube <roundcube@208e9e7b-5314-0410-a742-e7e81cd9613c>2005-11-06 19:26:45 +0000
commitc4c3624ba6b1ca47dc1434d4b606d25397480cbc (patch)
tree48cda1b3aaffa492e6ed1eb796c611a5ea2cc6ea /roundcubemail/program/js/common.js
parenta9f64635ff48ca1acc281d6d199a6fe244360e38 (diff)
Added localized messages to client and check form input
git-svn-id: https://svn.roundcube.net/trunk@76 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/js/common.js')
-rw-r--r--roundcubemail/program/js/common.js15
1 files changed, 14 insertions, 1 deletions
diff --git a/roundcubemail/program/js/common.js b/roundcubemail/program/js/common.js
index 78fecf8fe..0c9917ad9 100644
--- a/roundcubemail/program/js/common.js
+++ b/roundcubemail/program/js/common.js
@@ -6,7 +6,7 @@
| Copyright (C) 2005, RoundCube Dev, - Switzerland |
| Licensed under the GNU GPL |
| |
- | Modified:2005/10/21 (roundcube) |
+ | Modified:2005/11/06 (roundcube) |
| |
+-----------------------------------------------------------------------+
| Author: Thomas Bruederli <roundcube@gmail.com> |
@@ -264,6 +264,19 @@ function rcube_layer(id, attributes)
}
+// check if input is a valid email address
+function rcube_check_email(input, inline)
+ {
+ if (input && window.RegExp)
+ {
+ var reg_str = '([a-z0-9][-a-z0-9\.\+_]*)\@([a-z0-9]([-a-z0-9][\.]?)*[a-z0-9]\.[a-z]{2,9})';
+ var reg1 = inline ? new RegExp(reg_str, 'i') : new RegExp('^'+reg_str+'$', 'i');
+ var reg2 = /[\._\-\@]{2}/;
+ return reg1.test(input) && !reg2.test(input) ? true : false;
+ }
+ return false;
+ }
+
// find a value in a specific array and returns the index
function find_in_array()