From b1fafb6bee2c4846ba607bbd87898f3f5bb10832 Mon Sep 17 00:00:00 2001 From: Joey Schulze Date: Thu, 4 Mar 2010 15:35:52 +0100 Subject: [PATCH] Use general function to set variable --- masks/gereinigt.php | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/masks/gereinigt.php b/masks/gereinigt.php index c02c6fa..9895bbe 100644 --- a/masks/gereinigt.php +++ b/masks/gereinigt.php @@ -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( -- 2.20.1