Hi! So I have two "tabs" implemented using radio buttons as shown in the code (visibility is controled by CSS). There is one control in each tab contained in the div. I hope the code is clear enough.
Now, I am inside a javascript function where I have the control id (say "txtArea") and I need to find its parent tabid. Is there a way to trace the tabid (I mean the radio id) from the control id?
As I see it they don't have any direct or indirect relationship as per DOM structure but there is a link - the div id.
Let's see if this interests you :)
<input type="radio" id="tabGeneral" name="Tabs" value="tabGeneral" checked="" drive="divContentsGeneral,tabGeneral_selected,tabConstruction_unselected" />
<input type="radio" id="tabConstruction" name="Tabs" value="tabConstruction" drive="divContentsConstruction,tabConstruction_selected,tabGeneral_unselected" />
<!-- other controls -->
<!-- Tab1 contents -->
<div id="divContentsGeneral" style="DISPLAY: none">
<table border="0">
<tr>
<td><input id="txtStreetNumber" name="txtStreetNumber" type="text" /></td>
</tr>
</table>
</div>
<!-- Tab2 contents -->
<div id="divContentsConstruction" style="DISPLAY: none">
<table border="0">
<tr>
<td><input id="**txtArea**" name="txtArea" type="text" /></td>
</tr>
</table>
</div>