Fix javascript error
authorpdontthink <pdontthink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sun, 14 Sep 2003 05:59:17 +0000 (05:59 +0000)
committerpdontthink <pdontthink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sun, 14 Sep 2003 05:59:17 +0000 (05:59 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@5719 7612ce4b-ef26-0410-bec9-ea0150e637f0

include/options/display.php

index 1235ca13496a69c11583d64b1a32a32f4d39d580..49be36c03a0542d039a9f704e12c909b0c1b27cc 100644 (file)
@@ -19,7 +19,8 @@ define('SMOPT_GRP_MESSAGE', 2);
 /* Define the optpage load function for the display options page. */
 function load_optpage_data_display() {
     global $theme, $language, $languages, $js_autodetect_results,
-    $compose_new_win, $default_use_mdn, $squirrelmail_language, $allow_thread_sort;
+    $compose_new_win, $default_use_mdn, $squirrelmail_language, $allow_thread_sort,
+    $optmode;
 
     /* Build a simple array into which we will build options. */
     $optgrps = array();
@@ -99,8 +100,12 @@ function load_optpage_data_display() {
                            SMPREF_JS_OFF        => _("Never"))
     );
 
-    $onLoadScript = "document.forms[0].new_js_autodetect_results.value = '" . SMPREF_JS_ON . "'";
-    $js_autodetect_results = SMPREF_JS_OFF;
+
+    if ($optmode != 'submit')
+       $onLoadScript = 'document.forms[0].new_js_autodetect_results.value = \'' . SMPREF_JS_ON . '\'';
+    else
+       $onLoadScript = '';
+
     $optvals[SMOPT_GRP_GENERAL][] = array(
         'name'    => 'js_autodetect_results',
         'caption' => '',