XSP.getFieldValue = function getFieldValue(node) { if (node) { // Note, the node may have changed to a SPAN // if the edit box became read-only var type = (!node.type) ? null : node.type.toLowerCase(); if (type == 'radio' || type == 'checkbox') { if (node.checked) { return node.value; } return ''; } else if (type == 'fieldset') { var els= node.getElementsByTagName('input'); for(var i= 0; i<els.length; i++) { var el= els[i]; if (el.checked) return el.value; } return ''; } else if (node.multiple) { var sel = ''; for (var i = 0; i < node.options.length; i++) { if (node.options[i].selected) { if (sel) sel += ','; sel += node.options[i].value; } } return sel; } else if (typeof node.value != 'undefined') { return node.value; } } return null; };