From: Joey Schulze Date: Thu, 4 Mar 2010 22:51:48 +0000 (+0100) Subject: Support setting values to arbitrary objects using innerHTML X-Git-Tag: 2010-06-02_customer~119 X-Git-Url: https://git.infodrom.org/?p=misc%2Fkostenrechnung;a=commitdiff_plain;h=0d020b020b396de543f8b7ab02b23837c533e44e Support setting values to arbitrary objects using innerHTML --- diff --git a/lib/functions.js b/lib/functions.js index f1b6d4d..de69409 100644 --- a/lib/functions.js +++ b/lib/functions.js @@ -66,10 +66,12 @@ function set_value(id, value) obj.value = value; else if (obj.nodeName.toLowerCase() == 'span') obj.innerHTML = value; - else if (obj.nodeName.toLowerCase() == 'select') + else if (obj.nodeName.toLowerCase() == 'select') { for (var i=0; i < obj.options.length; i++) if (obj.options[i].value == value) obj.selectedIndex = i; + } else + obj.innerHTML = value; } function setvar(obj, name, callback, status)