PDA

View Full Version : Table checkbox fields(javascript loop)



r-a-l-p-h
05-29-2013, 03:08 AM
Hi all ,

I am newbie for JavaScript and i stack for this problem , I have table and inside my table i have a checkBox and button field each row
and my problem now is how can i get tha value of selected row with only checkBox is checked ones is button "Release" is click . Somebody help me please. Please see my below HTML code for my exact example for my TABLE.


<table id="Table1">
<thead>
<tr>
<td align="center">
Vessel name
</td>
<td align="center">
Vessel Reg. No.
</td>
<td align="center">
BL No.
</td>
<td align="center">
Consignee name
</td>
<td align="center">
Broker name
</td>
<td align="center">
</td>
<td align="center">
Valid until
</td>
</tr>
</thead>
<tbody id="Tbody1">

<tr>
<td>
AMOY DREAM
</td>
<td>
V.025/CHU0003-13
</td>
<td>
025RZ07
</td>
<td>
STEEL TRUST CORPORATION
</td>
<td>
ELISA R. MANEBO
</td>
<td>
<input type="checkbox">
</td>
<td>
<input id="inputDate" type="text">
</td>
<td>
<input id="btnRelease" value="Release" type="button">
</td>

</tr>


<tr>
<td>
BO SPRING
</td>
<td>
KYC0032-12
</td>
<td>
BSI1201KPOMNL007
</td>
<td>
MAXIMA STEEL MILLS CORPORATION
</td>
<td>
FELICITO SANTOS
</td>
<td>
<input type="checkbox">
</td>
<td>
<input id="inputDate" type="text">
</td>
<td>
<input id="btnRelease" value="Release" type="button">
</td>

</tr>

<tr>
<td>
ESSEX STRAIT
</td>
<td>
DTT001-13
</td>
<td>
BSSBSMN0402
</td>
<td>
PAG-ASA STEEL WORKS INC.
</td>
<td>
PHILIP FALCON
</td>
<td>
<input type="checkbox">
</td>
<td>
<input id="inputDate" type="text">
</td>
<td>
<input id="btnRelease" value="Release" type="button">
</td>
</tr>

<tr>
<td>
XIN HAI HE
</td>
<td>
SYI0001-13
</td>
<td>
XHHSM08
</td>
<td>
CARTER INDUSTRIAL CORP.
</td>
<td>
JOEL LIM
</td>
<td>
<input type="checkbox">
</td>
<td>
<input id="inputDate" type="text">
</td>
<td>
<input id="btnRelease" value="Release" type="button">
</td>
</tr>
</tbody>
</table>




Many thanks,
r-a-l-p-h

jscheuer1
05-29-2013, 04:41 AM
I'm sorry but even after copying the HTML and putting it up as a page inthe browser, I still cannot understand what you mean by:


my problem now is how can i get tha value of selected row with only checkBox is checked ones is button "Release" is click

Do you mean that only if a checkbox is checked can the release button be clicked? If so, try out this demo:

http://home.comcast.net/~jscheuer1/side/demos/tidbits/table-checkbox-button-h.htm

If that's what you want, use your browser's "View Source" to get the code.

If not, please explain just what you do want.