Use general function to set variable
authorJoey Schulze <joey@infodrom.org>
Thu, 4 Mar 2010 14:35:52 +0000 (15:35 +0100)
committerJoey Schulze <joey@infodrom.org>
Thu, 4 Mar 2010 14:35:52 +0000 (15:35 +0100)
masks/gereinigt.php

index c02c6fa..9895bbe 100644 (file)
@@ -10,17 +10,10 @@ function select_year_calback(data)
   grid_update(grid);
 }
 
-function select_year(obj)
+function select_year_status(obj, value, html)
 {
-  if (!obj.options[obj.selectedIndex].value.length)
-    val = -1;
-  else
-    val = obj.options[obj.selectedIndex].value;
-
-  ajax_request('setvar','source=gereinigt&name=year&value='+val,select_year_calback);
-
-  if (obj.options[obj.selectedIndex].value.length)
-    info('Jahr ' + obj.options[obj.selectedIndex].innerHTML + ' ausgewählt');
+  if (value.length)
+    info('Jahr ' + value + ' ausgewählt');
   else
     info('');
 }
@@ -40,6 +33,7 @@ $mask = array(
                                'default' => 'Jahr wählen',
                                'selected' => $_SESSION['gereinigt.year'],
                                'onchange' => 'select_year(this)',
+                               'onchange' => "setvar(this,'year',select_year_calback,select_year_status)",
                                ),
              'variables' => array('year'),
              'list' => array(