473,387 Members | 1,578 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

get inside element of table

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>

Jul 9 '06 #1
5 10815
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.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Temporarily at: http://members.aol.com/_ht_a/hikksnotathome/cljfaq/
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Jul 9 '06 #2
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
Jul 9 '06 #3

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

Jul 9 '06 #4

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

Jul 10 '06 #5

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

Jul 10 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Amir Hardon | last post by:
I'm new to DOM and can't figure out this thing: I'm trying to add a row to a table with a form field in one of it's cells, but if I'm appending the field to a form it gets out of the table. Can...
14
by: Zenobia | last post by:
Hello folks, Is it possible to position an item within a <td> element? For instance see below. The table has multiple rows, one for each database record. Each row has 3 hrefs associated with it...
2
by: Asad | last post by:
I have a form on a page that has several textareas, and textboxes inside a table (so the table containing the textboxes is also inside the FORM tag). I want to replace the textareas with simple...
4
by: Dacian | last post by:
Hi, I´m trying to place a javascript navigation menu inside a cell of a table in my page, the problem is that the constructor of the menu object has parameters for menu positioning and size and...
1
by: five of nothing | last post by:
Hi, I'm working on a page and my HTML validator whines when I try to put a <div></div> or a <table></table> inside of an <a></a> tag. What are the rules as far as what can go in there?
3
by: axlq | last post by:
I created an experimental page at: http://sunbeam.rahul.net/~unicorn/csstest.html ....which is a standard header + nav bar + 2-column content + footer CSS layout. The left column is 10em wide...
2
by: taras.di | last post by:
Hi everyone, I know that there's been a bit of discussion involving placing <div>s inside table cells, but I've read all of the posts and couldn't find anything that solved my problem. I've...
3
by: gruntledlark | last post by:
i'm trying to create a style sheet for an existing web application. I have pages that the app generates that gives me input fields inside of table cells. like this: <td><input></td> my...
4
by: chudzikr | last post by:
Hi- I have a question that I haven't been able to find any info on: If I have an element (say, a <divor a <table>) which is a certain fixed width (let's say 500px). If I add a CSS border of...
3
by: rlueneberg | last post by:
I want to change the color of an "a" child element inside a table cell via javascript. Is there any way to do that? Ps: there is no id assigned to child elements. I would like to discover the child...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.