From 3f4c6c3b884fffd8a0cc64b006e1bdc0d13b06cf Mon Sep 17 00:00:00 2001 From: pdontthink Date: Tue, 11 Mar 2003 20:29:25 +0000 Subject: [PATCH] Turned off validation scripts for widgets when javascript is disabled git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@4648 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/options.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/functions/options.php b/functions/options.php index b3ade283..4d1a8904 100644 --- a/functions/options.php +++ b/functions/options.php @@ -274,34 +274,34 @@ class SquirrelOption { } function createWidget_Integer() { - return ($this->createWidget_String()); - /* FIXME: Paul, weren't you going to make this browser safe - ie, if JS was off, or browser didn't support it? + global $javascript_on; // add onChange javascript handler to a regular string widget // which will strip out all non-numeric chars - return preg_replace('/>/', ' onChange="a=this.value; b=\'\'; ' + if ($javascript_on) + return preg_replace('/>/', ' onChange="a=this.value; b=\'\'; ' . 'for (i=0;i=\'0\' ' . '&& a.charAt(i)<=\'9\') b += a.charAt(i); } ' . 'this.value=b;">', $this->createWidget_String()); - */ + else + return $this->createWidget_String(); } function createWidget_Float() { - return ($this->createWidget_String()); - /* FIXME: Paul, weren't you going to make this browser safe - ie, if JS was off, or browser didn't support it? + global $javascript_on; // add onChange javascript handler to a regular string widget // which will strip out all non-numeric (period also OK) chars - return preg_replace('/>/', ' onChange="a=this.value; b=\'\'; ' + if ($javascript_on) + return preg_replace('/>/', ' onChange="a=this.value; b=\'\'; ' . 'for (i=0;i=\'0\' ' . '&& a.charAt(i)<=\'9\') || a.charAt(i)==\'.\') ' . 'b += a.charAt(i); } this.value=b;">' , $this->createWidget_String()); - */ + else + return $this->createWidget_String(); } function createWidget_Boolean() { -- 2.25.1