get inside element of table

B

benyovi

Hi I got this table and i need to get the data of "cbIsInUse" if
checked or not for every row.
how do i do that ??

thanks Amir

<table id="fieldsTable" width="100%" border="0" cellspacing="0">
<tr class="gridHeader" id="DataRowHeader" width="100%">
<td class="gridListboxField" id="ColIsInUse" width="15px">
&nbsp;
</td>
<td class="gridListboxField" id="ColFieldName">
<ml:text componentName="<%=request.getServletPath()%>"
elementName="lblName"/>
</td>
<td class="gridListboxField" id="ColFieldPosition">
<ml:text componentName="<%=request.getServletPath()%>"
elementName="lblPosition"/>
</td>
<td class="gridListboxField" id="ColFieldLength">
<ml:text componentName="<%=request.getServletPath()%>"
elementName="lblLength"/>
</td>
</tr>

<logic:iterate name="EditExternalStickersFileTypeForm"
property="allFields" id="CurrRowData">
<tr id="DataRow<%=rowID++%>" width="100%"
onclick="rowClicked(this);">
<td class="gridListboxField" id="ColID" style="display:none">
<html:text styleId="fieldID" name="CurrRowData"
property="ID"/>
</td>
<td class="gridListboxField" id="ColIsInUse" width="15px">
<html:multibox styleId="cbIsInUse"
name="EditExternalStickersFileTypeForm" property="fieldsInFileIDs">
<bean:write name="CurrRowData" property="ID"/>
</html:multibox>
</td>
<td class="gridListboxField" id="ColFieldName">
<bean:write name="CurrRowData" property="name"/>
</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>
</logic:iterate>
</table>
 
M

Matt Kruse

benyovi said:
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.
 
R

Randy Webb

benyovi said the following on 7/9/2006 10:29 AM:
Hi I got this table and i need to get the data of "cbIsInUse" if
checked or not for every row.
how do i do that ??

Write a script that checks the checked property.

Don't expect a fully written free script, you have to at least try first.

<snip>

Don't post your server side code, post the code that the client sees.
And preferable to that is a URL to a sample page that shows your best
effort and any problems you may have.
 
B

benyovi

Matt said:
Could you be more specific about what you really want?


Don't post your JSP source, post the actual html that it generates.

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??
 
B

benyovi

benyovi said:
Matt said:
Could you be more specific about what you really want?


Don't post your JSP source, post the actual html that it generates.

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??
 
B

benyovi

benyovi said:
benyovi said:
Matt said:
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.

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">
&nbsp;

</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>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,772
Messages
2,569,593
Members
45,111
Latest member
KetoBurn
Top