Z
Zhao
I have a loop as following
<logic:iterate id="BambooItem" name="BambooListForm"
property="bambooItemList" indexId="ctr">
<tr>
<td<html:text name="BambooItem" property="orderedNum"
indexed="true" size="4" />
....
The generated html code looks like this
<input type="text" name="BambooItem[0].orderedNum" size="4" value="1">
The challege is that it is hard to access this element from javascipt.
I tried
document.getElementsByName("BambooItem[0].orderedNum");
and it is an object but
document.getElementsByName("BambooItem[0].orderedNum").value is always
"undefined".
Since there is a "." within the name (="BambooItem[0].orderedNum") so
it is impossible to use something like
document.formname.elementname
And there is no way in "html:text" to set the id attribute of the html
element
so I can't use getElementById either...
What a Struts!
Any suggestion will be really appreciated.
thanks
<logic:iterate id="BambooItem" name="BambooListForm"
property="bambooItemList" indexId="ctr">
<tr>
<td<html:text name="BambooItem" property="orderedNum"
indexed="true" size="4" />
....
The generated html code looks like this
<input type="text" name="BambooItem[0].orderedNum" size="4" value="1">
The challege is that it is hard to access this element from javascipt.
I tried
document.getElementsByName("BambooItem[0].orderedNum");
and it is an object but
document.getElementsByName("BambooItem[0].orderedNum").value is always
"undefined".
Since there is a "." within the name (="BambooItem[0].orderedNum") so
it is impossible to use something like
document.formname.elementname
And there is no way in "html:text" to set the id attribute of the html
element
so I can't use getElementById either...
What a Struts!
Any suggestion will be really appreciated.
thanks