[KULRICE-7212] Onclick script not getting associated with correct control ids for checkbox Created: 29/Apr/12  Updated: 03/Apr/13  Resolved: 01/May/12

Status: Closed
Project: Kuali Rice Development
Component/s: Development
Affects Version/s: None
Fix Version/s: 2.2.0-m1, 2.2
Security Level: Public (Public: Anyone can view)

Type: Task Priority: Major
Reporter: Jerry Neal (Inactive) Assignee: Daniel Seibert (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
cloned from KULRICE-7208 Template Closed
Rice Module:
KAI Review Status: Not Required
KTI Review Status: Not Required


When using a checkbox control instead of a text control and configuring onclick script, the id selector doesn't come out correct. Note the specific ids have changed in 2.2.

Add a sample to configuration test view for verifying this functionality.

Here's the whole <span> created for the checkbox which fails:

<span id="u507_line0_attribute_span" class="uif-field uif-inputField">
<input id="u507_line0_attribute" class="uif-control uif-checkboxControl valid"
type="checkbox" value="true" tabindex="0" name="holidays[0].instructional"
<input type="hidden" value="on" name="_holidays[0].instructional">
<input type="hidden" value="jq('#' + 'u507_line0').click(function(e)

{ alert('click'); });" script="first_run">
<span id="u507_line0_attribute_markers"></span>
<span id="u507_line0_attribute_info_message"></span>

The jq selector is looking for element id 'u507_line0' which doesn't exist; it should have been looking for the visible element 'u507_line0_attribute'. (why 'attribute'?). Here's what gets generated for a TextControl which works:

<span id="u324_add_attribute_span" class="uif-field uif-inputField">
<input id="u324_add" class="uif-control uif-textControl KS-HolidayCalendar-HolidaySection-addField validChar-newCollectionLines['holidays'].startTime0 valid"
type="text" size="4" value="" tabindex="0"
placeholder="hh:mm " aria-invalid="false">
<input class="ignoreValid" type="hidden"
value="createWatermark('u324_add', "hh:mm ");"
<input class="ignoreValid"
type="hidden" value="jq('#' + 'u324_add').click(function(e) { alert('click'); }

);" script="first_run">
<span id="u324_add_attribute_markers"></span>
<span id="u324_add_attribute_info_message"></span>

Here the jq selector is 'u324_add' which is the id for the visible input field. I assume the DropdownControl and maybe some others have the same problem as the CheckboxControl.

Comment by Jerry Neal (Inactive) [ 30/Apr/12 ]


I think this is probably not an issue in 2.2 with the work that has been done with IDs. But we should verify.


Comment by Daniel Seibert (Inactive) [ 01/May/12 ]

This issue has already been fixed.
Verified that onClick operates as expected for checkbox controls.

Generated at Tue Aug 04 06:47:25 CDT 2020 using JIRA 7.0.11#70121-sha1:19d24976997c1d95f06f3e327e087be0b71f28d4.