Is there a way to port the following javascript to XEL
function getSelectedContentProvidersAsString() {
var cpCheckboxes = document.getElementsByName("cp");
var strSelectedContentProviders = "";
for (i=0; i<cpCheckboxes.length; i++) {
var curCpChecbox = cpCheckboxes[i];
if (curCpChecbox.checked && !curCpChecbox.disabled) {
strSelectedContentProviders+=curCpChecbox.value;
strSelectedContentProviders+=",";
}
}
return strSelectedContentProviders;
}
I want to store the return value of this function in a variable.
Currently this looks like the following:
<e:variable name="strSelectedContentProviders" select="javascript:getSelectedContentProvidersAsString()"/>
I would rather port this function to XEL for compatibility reasons and because it is a requirement to the product.
TIA,

Hi, You can XPath to do the
3 September, 2007 - 21:08 — SjoerdHi,
You can XPath to do the same, something like:
- string-join() function joins a resultset (http://www.w3.org/TR/xpath-functions/#func-string-join)
- //cp selects all CP tags in the document
- [property::checked and property::disabled] filters the resultset to only those with property checked is true and property disabled is true
- /property::value selects the actual value of the resultset and not the nodes
document.getElementsByName
4 September, 2007 - 09:14 — sanderdocument.getElementsByName returns the tags which's name attribute is the given value and i wanted the elements which are enabled (not disabled),
but i assume that the statement should look like: