October 28, 2011, 04:14 PM
j.grossQuestion on tab components
Is there a way for a javascript function to sense which of a set of tabs (created by HTML Composer, 7.7.03) is currently selected?
I can keep track once there is a click event; but is there a simple way to sense the initial status, on load, of each tabset?
November 01, 2011, 10:03 PM
j.gross45 views, no responses.
November 01, 2011, 11:51 PM
njsdenAt least you catched our interest on the subject
Sadly nobody seems to know the answer yet ... I know I don't
Sorry.
November 02, 2011, 10:52 AM
Kofijgross,
You can be doing something like -
var tabs = document.getElementsByTagName("SPAN");
alert(tabs.length);
for(var i = 0; i < tabs.length; i++) {
if(tabs[i].elementtype == "40") {
alert(tabs[i].id+" - "+tabs[i].style.display);
}
}
The style.display will be giving you whether the tab content SPAN is being displayed or not and it then be the one selected.
but you will have to be making sure that the DOM has necessary content menaing the page is being fuly loaded.
Note that the first tab is not appearing to have the same sort of span?
Kofi
November 02, 2011, 12:25 PM
Ram Prasad EIf you want to verify this during page load, you can try assigning same html file as a DOM object and traverse down to validate the SPAN tag attribute 'selectedtab="true"'.
true says the tab is selected.
November 02, 2011, 12:42 PM
KofiRam,
The value for "selectedtab" is not being changed if other tab being selected. It is being used in startup only for showing default tab.
Kofi
November 02, 2011, 12:51 PM
Ram Prasad EHi Kofi,
Even j.gross in interested to do startup load validation.
-Ram