November Happy Hour will be moved to Thursday December 5th.
AI OnAI Off
November Happy Hour will be moved to Thursday December 5th.
function CheckSomeCheckboxes(element)
{
try
{
if (element.type)
{
// look for checkbox
if ((element.tagName.toLowerCase() == "input") && (element.type == "checkbox") && (element.disabled == false))
{
// check if name ends with Checked
if (element.value.search(/Checked$/i) != -1)
{
// check the checkbox
element.checked = true;
// find the checkbox' sibling (checkbox text is kept in a label next to the checkbox)
if ((element.nextSibling) && (element.nextSibling.tagName.toLowerCase() == "label"))
{
// Remove the "Checked" text from the label
element.nextSibling.innerHTML = element.nextSibling.innerHTML.replace(/Checked$/i,"");
}
}
}
}
}
catch(E){alert("hmm:"+E);}
if (element.childNodes && element.childNodes.length > 0) {
for (var x = 0; x < element.childNodes.length; x++) {
CheckSomeCheckboxes(element.childNodes[x]);
}
}
}
Below the code which includes the xform (lets say it is contained in a div with id=ContentArea), I then call the function to check the relevant checkboxes:
CheckSomeCheckboxes(document.getElementById("ContentArea"));
I guess a similar approach can be used to select a default radiobutton etc. Hope this can help others with a similar problem!
If anyone have a more elegant solution, please let me know :-)
-b