I have a view with the Allow Selection of Documents option selected.
I would like to select all of the checkboxes initially, but I am not sure how to access the checkboxes - does domino automatically name these checkboxes?
Any information would be greatly appreciated - thanks in advance!
Subject: Checkboxes Generated by View - How to access??
yes, Domino generates hidden input tags using name $$SelectDocs
example:
var oIDs = document.getElementsByName( ‘$$SelectDoc’ );
will return an array with all check boxes
process the array to fetch selected UNIDs:
if( oIDs.length ) {
for( var j = 0; j < oIDs.length; j++ )
if( oIDs[j].checked )
cNoteIDs += ( cNoteIDs == “” ? “” : “,” ) + oIDs[j].value;
} else { // just one check box
if( oIDs.checked ) cNoteIDs = oIDs.value;
}
Subject: RE: Checkboxes Generated by View - How to access??
Thanks for your response. I checked the R4 and R5 forum and found the following code, which I placed in the onLoad event of the form. It works as well:
var x = 0;
var form = document.forms(0)
for (var i = 0; i < form.elements.length; i++) {
if (form.elements[i].type == “checkbox”) {
form.elements[i].checked = true;
}
}
Thanks again.
Subject: RE: Checkboxes Generated by View - How to access??
it will work well if you have only these Domino generated check boxes, check the name too