@chrishirst: no luck there.
ok, more information. this now may be more appropriate for the JS forum.
i am trying to extend
usableforms, which is an outstanding script for show/hide of descendant form-elements based on user actions elsewhere in that form.
for example, to reveal a text-field upon user-click of a checkbox:
Code:
<input type="checkbox" name="email" rel="email"><br>
<div rel="email"><input type="text" name="email"></div>
Within an external .js file, you specify whether the container bound to the REL attribute is TR or DIV (i'm set to DIV).
So in the example above, any DIV with a REL attribute is hidden onLoad. The checkbox and the DIV have corresponding REL attributes
Toggling the checkbox shows & hides the corresponding DIV.
This is a basic example.
What i'm wanting to do is have that one checkbox trigger two separate DIVs, each with a unique REL.
Due to other layout constraints, i cannot stick these 2 separate DIVs inside of one common DIV and have the checkbox bind to that.
Here's a stripped down scenario:
- Multiple rows of data, each giving the end user option to REMOVE (via checkbox)
- Each row has its own REMOVE checkbox
- OnClick of the REMOVE checkbox, i want to reveal a DIV containing DATE REMOVED fields for that row only.
- OnClick of the same checkbox, i want the "Date Removed" column header to also display.
Code:
<tr class="headrow">
<td id="first">First Name</td>
<td id="last">Last Name</td>
<td id="remove">Remove</td>
<td id="dt_remove">
<div rel="dt_remove_head">Date Removed</div>
</td>
</tr>
<tr>
<td id="first">Joe</td>
<td id="last">Smith</td>
<td id="remove">
<input type="checkbox" name="remove1" rel="dt_remove1">
</td>
<td id="dt_remove">
<div rel="dt_remove1">
<input type="text" name="mm"> / <input type="text" name="dd" > / <input type="text" name="yyyy" >
</div>
</td>
</tr>
<tr>
<td id="first">Roquel</td>
<td id="last">Ross</td>
<td id="remove">
<input type="checkbox" name="remove2" rel="dt_remove2">
</td>
<td id="dt_remove">
<div rel="dt_remove2">
<input type="text" name="mm"> / <input type="text" name="dd"> / <input type="text" name="yyyy">
</div>
</td>
</tr>
Again, i want the REMOVE checkbox on each row to show/hide 2 different/separate DIVS:
A: the DIV containing the "Date Removed" column header
B: the DIV containing the date fields for just that row
My original post to this forum was to see if i could have the checkbox pass 2x REL attributes (A + B)
Clearly there's more to it then that.
Sorry so long. I know you all are as busy as i am. So, thanks in advance for any assistance.