Details
-
Improvement
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
1.1 RC1
-
None
-
Operating System: All
Platform: All
-
20459
Description
The javascript generated when using focus and focusIndex does not account for the
following prolblem:
We have a radio button group that is dynamically created based on a database
query. There may be 1 or more items in the group. In the case where a single
item exists, the radio button does NOT have any sub-elements, so in that case we
need to use JUST the focus attribute of the form tag. However, if the radio
button has more than one element we need to use both the focus and the
focusIndex attributes. It would be highly desirable to be able to always specify
the focus attribute to the name of the radio button and if the focusIndex is NOT
specified but sub-elements do exist, the focus is set to the "0" element for the
control.
EX:
My form is "referralsToPvdReport"
The field "selectedIndices" is a checkbox group (checkboxes with the same name)
The checkboxes are created by iterating over a collection of database records
and therefore the index will conditionally be present if more than one record
needs to be rendered.
var focusControl =
document.forms["referralsToPvdReport"].elements["selectedIndices"];
if (focusControl.type != "hidden") {
if (focusControl[0])
else
{ focusControl.focus(); }}
Attachments
Issue Links
- is duplicated by
-
STR-3112 Generated javascript is wrong to set focus on control that is of array
- Resolved