Skip to main content
This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal

HCL Notes/Domino 8.5 Forum (includes Notes Traveler)

HCL Notes/Domino 8.5 Forum (includes Notes Traveler)

Previous Next
Subject: CheckBoxGroup in client side scripting - error?
Feedback Type: Question
Product Area: Domino Designer on Eclipse (DDE)
Technical Area: Functionality
Platform: Not Applicable
Release: 8.5.2
Reproducible: -Reproducibility-

I have two fields on an xpage..one an edit box (named wordstring1 which is used so I can make sure the alerts are working) and a checkboxgroup control called checkBoxGroup1.

The wordstring control generates this source:

<xp:inputText
value="#{dominoDocument1.wordstring}" id="wordstring1"
style="width:359.0px">
</xp:inputText>
which generates:
<td style="width:92.0px"><input type="text" id="view:_id1:_id26:wordstring1" name="view:_id1:_id26:wordstring1" style="width:359.0px" class="xspInputFieldEditBox"></td>

The checkboxgroup control generates this source:
<xp:td><xp:checkBoxGroup id="checkBoxGroup1" layout="pageDirection" value="#{dominoDocument1.DBChoice}" style="font-weight:bold">
<xp:selectItems id="selectItems1">
<xp:this.value><![CDATA[#{javascript:sessionScope.SearchDBs}]]></xp:this.value>
</xp:selectItems>
</xp:checkBoxGroup></xp:td>
which generates

<td colspan="2" style="width:277.0px"><fieldset id="view:_id1:_id26:checkBoxGroup1" style="font-weight:bold" class="xspCheckBox"><table class="xspCheckBox" style="font-weight:bold">

<tr>
<td>
<label><input name="view:_id1:_id26:checkBoxGroup1" value="a) NOTEbookS Catalog" type="checkbox"> a) NOTEbookS Catalog</input></label></td>
</tr>
<tr>
<td>
<label><input name="view:_id1:_id26:checkBoxGroup1" value="b) NOTEbookS Serials" type="checkbox"> b) NOTEbookS Serials</input></label></td>
</tr>
<tr>

<td>
<label><input name="view:_id1:_id26:checkBoxGroup1" value="c) Catboat Knowledgebase" type="checkbox"> c) Catboat Knowledgebase</input></label></td>
</tr>
<tr>
<td>
<label><input name="view:_id1:_id26:checkBoxGroup1" value="d) Competitive Intelligence" type="checkbox"> d) Competitive Intelligence</input></label></td>
</tr>
<tr>
<td>

<label><input name="view:_id1:_id26:checkBoxGroup1" value="e) NOTEbookS Research (General)" type="checkbox"> e) NOTEbookS Research (General)</input></label></td>
</tr>
</table></fieldset></td>

I have a button which has the following code in the client side:

var srchType = window.document.getElementById("#{id:wordstring1}");
alert (srchType.value);
var dbs = window.document.getElementById("#{id:checkBoxGroup1}");
alert (dbs.length);
alert (dbs[0].checked);

To test I select the first checkbox in the checkboxgroup and enter "abcd" in the edit field


The first alert pops up fine with the results of "abcd".

The second alert pops up as "undefined".

The third alert doesn't do anything.



Am I missing something, or is there a problem in the way the interpreter handles getElementById's for arrays?


Feedback number WEBB8SSNN6 created by ~Michelle Minkilitnivu on 03/27/2012

Status: Open
Comments:

CheckBoxGroup in client side script... (~Michelle Minki... 27.Mar.12)
. . Use getElementsByName... (~George Umboosi... 27.Mar.12)




Printer-friendly

Search this forum

Member Tools


RSS Feeds

 RSS feedsRSS
All forum posts RSS
All main topics RSS