View Full Version : Help with onclick in DD Tab menu

11-22-2006, 04:57 PM
1) Script Title: DD Tab Menu

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex1/ddtabmenu.htm

3) Describe problem: Can someone help me figure out the right approach to my problem, please? I've got a test menu set up at http://www.ni-econdev.com/edit/tab3.asp that opens up two list boxes. When a selection is made in the first, the second is populated with choices appropriate to that selection. When a selection is made in the second box, I want to shift to the second tab. I'm currently using an onclick statement to accomplish this. However, when jumping to the second tab this way, the tab itself is not changed to white (indicating current tab). What am I doing wrong?

11-23-2006, 02:02 AM
Firstly, please note that your page is currently in violation of our usage terms, since the credit notice doesn't appear inline on the page. Please reinstate the credit notice.

Regarding your question, the easiest way to just to switch to the Tab Content script instead, as it supports a built in way of dynamically selecting a different tab, by calling the code:

expandtab(tabcontentid, tabnumber)

This is explained on the script page.

11-28-2006, 06:22 PM
Sorry about the script attribution. It got deleted as I was attempting to strip out all non-critical code in solving my problem.

I'm not sure I understand your recommendation. The code behind the tabs is exactly what your script calls for (ONCLICK="return expandcontent('sc2',this)"; theme="white">) and I've replicated that in my second drop down list as the code for the onclick event (ONCLICK="return expandcontent('sc2',this)"; theme='white'>). Everything works fine except that the tab background color doesn't change to white when that div opens up. What am I missing?