[LON-CAPA-cvs] cvs: loncom(version_2_11_X) /interface lonhtmlcommon.pm

raeburn raeburn at source.lon-capa.org
Tue Jul 30 10:15:59 EDT 2019


raeburn		Tue Jul 30 14:15:59 2019 EDT

  Modified files:              (Branch: version_2_11_X)
    /loncom/interface	lonhtmlcommon.pm 
  Log:
  - For 2.11
    Backport 1.388
  
  
Index: loncom/interface/lonhtmlcommon.pm
diff -u loncom/interface/lonhtmlcommon.pm:1.358.2.16 loncom/interface/lonhtmlcommon.pm:1.358.2.17
--- loncom/interface/lonhtmlcommon.pm:1.358.2.16	Sat Jul 27 13:57:31 2019
+++ loncom/interface/lonhtmlcommon.pm	Tue Jul 30 14:15:59 2019
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common html routines
 #
-# $Id: lonhtmlcommon.pm,v 1.358.2.16 2019/07/27 13:57:31 raeburn Exp $
+# $Id: lonhtmlcommon.pm,v 1.358.2.17 2019/07/30 14:15:59 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -3528,15 +3528,18 @@
 # javascript_valid_email
 #
 # Generates javascript to validate an e-mail address.
-# Returns a javascript function which accetps a form field as argumnent, and
+# Returns a javascript function which accepts a form field as argument, and
 # returns false if field.value does not satisfy two regular expression matches
 # for a valid e-mail address.  Backwards compatible with old browsers without
 # support for javascript RegExp (just checks for @ in field.value in this case). 
 
 sub javascript_valid_email {
     my $scripttag .= <<'END';
-function validmail(field) {
+function validmail(field,suffix) {
     var str = field.value;
+    if (suffix != '' && suffix != undefined) {
+        str += suffix;
+    }
     if (window.RegExp) {
         var reg1str = "(@.*@)|(\\.\\.)|(@\\.)|(\\.@)|(^\\.)";
         var reg2str = "^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$"; //"




More information about the LON-CAPA-cvs mailing list