Don't assume we are the first form on the page
authorpdontthink <pdontthink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 7 May 2008 16:44:01 +0000 (16:44 +0000)
committerpdontthink <pdontthink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 7 May 2008 16:44:01 +0000 (16:44 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@13105 7612ce4b-ef26-0410-bec9-ea0150e637f0

include/options/display.php
src/options.php

index 3840920..4ba3945 100644 (file)
@@ -197,7 +197,7 @@ function load_optpage_data_display() {
                            SMPREF_JS_ON         => _("Always"),
                            SMPREF_JS_OFF        => _("Never")),
         'save'    => 'save_option_javascript_autodetect',
-        'extra_attributes' => array('onclick' => 'document.forms[0].new_js_autodetect_results.value = \'' . SMPREF_JS_ON . '\';'),
+        'extra_attributes' => array('onclick' => 'document.option_form.new_js_autodetect_results.value = \'' . SMPREF_JS_ON . '\';'),
     );
 
     $optvals[SMOPT_GRP_GENERAL][] = array(
index facbe52..c5d52e4 100644 (file)
@@ -424,7 +424,7 @@ if ($optpage == SMOPT_PAGE_MAIN) {
     }
 
     // Begin output form
-    echo addForm('options.php', 'post', 'f')
+    echo addForm('options.php', 'post', 'option_form')
        . create_optpage_element($optpage)
        . create_optmode_element(SMOPT_MODE_SUBMIT);