benyovi wrote:
benyovi wrote:
Matt Kruse wrote:
benyovi wrote:
Hi I got this table and i need to get the data of "cbIsInUse" if
checked or not for every row.
>
Could you be more specific about what you really want?
>
<logic:iterate name="EditExternalStickersFileTypeForm"
property="allFields" id="CurrRowData">
>
Don't post your JSP source, post the actual html that it generates.
>
--
Matt Kruse
http://www.JavascriptToolbox.com
http://www.AjaxToolbox.com
i think i have found the solution. but maybe u have better one.
// first i creat Rows object
allFieldsRows = document.getElementById("fieldsTable").rows;
//than i can get the elment data by
alert(allFieldsRows[x].cells["ColIsInUse"].childNodes[1].checked);
//this show the the data in message as i wanted.
do u have better way to get this data??
Ok i found how to get the "ColIsInUse" value of the chekbox.
but now i need the value of "fieldPosition" that is under the
"ColFieldPosition".
i tryied to use also
allFieldsRows[x].cells["ColFieldPosition"].childNodes[1].value
but this isn't work
does anyone know why??
this is the HTML code in the client side:
<table>
<tr>
<td>Name:</td>
<td><input type="text" name="name" value="General External
File" class="largeText" id="txtName"></td>
</tr>
<tr>
<td>
<input type="radio" id="rbDelimited"
name="rgDelimitedFixed" onchange="setFieldState();"
onfocus="setFieldState();" onclick="setFieldState();" checked>
<label for="rbDelimited">
Delimiter:
</label>
</td>
<td>
<input type="text" name="delimiter" value=";"
onfocus="checkItem(rbDelimited)" class="largeText" id="txtDelimiter">
</td>
</tr>
<tr>
<td>
<input type="radio" id="rbFixedLength"
name="rgDelimitedFixed" onchange="setFieldState();"
onfocus="setFieldState();" onclick="setFieldState();">
<label for="rbFixedLength">
Fixed Length
</label>
</td>
<td></td>
</tr>
<tr>
<td>
<input type="checkbox" id="cbEOFFlag"
onchange="setFieldState();" onfocus="setFieldState();"
onclick="setFieldState();" checked>
<label for="cbEOFFlag">
EOF Flag:
</label>
</td>
<td><input type="text" name="EOFFlag" value=""
onfocus="checkItem(cbEOFFlag);" class="largeText" id="txtEOFFlag"></td>
</tr>
<tr>
<td valign="top">Fields: </td>
<td>
<div style="overflow:auto; overflow-y:scroll;
border-style:inset; border-width:2px;">
<table id="fieldsTable" width="100%" border="0"
cellspacing="0">
<tr class="gridHeader" id="DataRowHeader"
width="100%">
<td class="gridListboxField"
id="ColIsInUse" width="15px">
</td>
<td class="gridListboxField"
id="ColFieldName">
Name
</td>
<td class="gridListboxField"
id="ColFieldPosition">
Position
</td>
<td class="gridListboxField"
id="ColFieldLength">
Length
</td>
</tr>
<tr id="DataRow0" width="100%"
onclick="rowClicked(this);">
<td class="gridListboxField" id="ColID"
style="display:none">
<input type="text" name="ID" value="1"
id="fieldID">
</td>
<td class="gridListboxField"
id="ColIsInUse" width="15px">
<input type="checkbox"
name="fieldsInFileIDs" value="1" checked="checked" id="cbIsInUse">
</td>
<td class="gridListboxField"
id="ColFieldName">
Product Num
</td>
<td class="gridListboxField"
id="ColFieldPosition">
<!--bean:write name="CurrRowData"
property="position"/-->
<input id="fieldPosition"
class="largeText" type="text" onclick="window.event.cancelBubble =
true;"/>
</td>
<td class="gridListboxField"
id="ColFieldLength">
<!--bean:write name="CurrRowData"
property="length"/-->
<input id="fieldLength" class="largeText"
type="text" onclick="window.event.cancelBubble = true;"/>
</td>
</tr>
<tr id="DataRow1" width="100%"
onclick="rowClicked(this);">
<td class="gridListboxField" id="ColID"
style="display:none">
<input type="text" name="ID" value="2"
id="fieldID">
</td>
<td class="gridListboxField"
id="ColIsInUse" width="15px">
<input type="checkbox"
name="fieldsInFileIDs" value="2" checked="checked" id="cbIsInUse">
</td>
<td class="gridListboxField"
id="ColFieldName">
Sticker Size
</td>
<td class="gridListboxField"
id="ColFieldPosition">
<!--bean:write name="CurrRowData"
property="position"/-->
<input id="fieldPosition"
class="largeText" type="text" onclick="window.event.cancelBubble =
true;"/>
</td>
<td class="gridListboxField"
id="ColFieldLength">
<!--bean:write name="CurrRowData"
property="length"/-->
<input id="fieldLength" class="largeText"
type="text" onclick="window.event.cancelBubble = true;"/>
</td>
</tr>
</table>
</div>
</td>
</tr>
<tr>
<input type="hidden" name="fieldsInFileStr"
value="1#@!VALUE!@#0#@!VALUE!@#-1#@!FIELD!@#2#@!VALUE!@#1#@!VALUE!@#-1#@!FIELD!@#"
id="txtFieldsInFileStr">
<input type="hidden" name="ignoreLengthValue" value="-1"
id="txtIgnoreLengthValue">
<input type="hidden" name="queryFieldsDelimiter"
value="#@!FIELD!@#" id="txtQueryFieldsDelimiter">
<input type="hidden" name="queryValuesDelimiter"
value="#@!VALUE!@#" id="txtQueryValuesDelimiter">
</tr>
</table>