0

I have a modal window using ModalBox that utilizes Spry Tabbed Panels inside of it. There are several panels inside the window which is supposed to be a account management window of sorts. My problem comes with calling, by an onclick event, a specific tab from a hyperlink, inside the ModalBox window. It just plain doesn't work.

However, when run independently in a new window, the page works as it should, as does the link to the specific tab.

I'm assuming that there's some javascript interference at play - I just can't seem to find it. Has anyone else experienced this? There's no documentation anywhere that I've found.

Any ideas?

<a href='#' class='account_content' style='text-decoration: none;' onclick="TabbedPanels2.showPanel(2);"><span class='account_content'>Add one now</span></a>

Code that opens modal window:

<a href="../../../myzp.php" title="My Zero Point" onClick="this.blur(); Modalbox.show('../../../myzp.php', {title: 'My Zero Point', width: 1100, height: 800}); return false;">
jbrown574
  • 99
  • 1
  • 3
  • 10
  • You really should post a small subset of the code which duplicates this problem. There are many potential issues in your javascript or HTML that could be the cause. – John Fisher Apr 20 '12 at 16:18
  • Like I said, it works perfectly outside of the ModalBox window... it's just getting it to work in the window that is the problem. – jbrown574 Apr 20 '12 at 16:30
  • That points to something in your HTML or JavaScript that creates the modal box. Have you posted that code for us to look at? – John Fisher Apr 20 '12 at 16:43
  • The problem is, I would have to post all of the code for the whole page which includes javascript, php, MySQL and html and some css. I'd rather not have to post the entire page if I can help it. I was asking a general question as to whether this was a common problem and if anyone had encountered it before. I'll post the code that creates the window, but I don't think it'll help much. – jbrown574 Apr 20 '12 at 16:53
  • That's sensible, but I doubt anyone will be of any specific help without some code to demo the problem. We can throw out ideas maybe, but this is a very specific case. It is unlikely that enough people have 1) had the same problem, 2) seen this post, and 3) thought they could answer it. – John Fisher Apr 20 '12 at 16:56
  • Go to http://zeropointusa.dpigraphics.net/Products/index.php - login using the link at the top. UN- temp, PW password. Click my account and try to add a shipping address via the link. – jbrown574 Apr 21 '12 at 14:56

1 Answers1

0

Apparently, because of the way Prototype processes functions, anything in any script on your page that is declared "var" will more or less be ignored and not evaluated by the script. At the bottom, where I had declared my tabbed panels, the code had been this:

var TabbedPanels2 = new Spry.Widget.TabbedPanels("TabbedPanels2");

by removing "var" which made the code look like this:

TabbedPanels2 = new Spry.Widget.TabbedPanels("TabbedPanels2");

I was able to get the onclick event to work inside the tabbed panels, inside the ModalBox window. Thanks for any assistance on this - I had to really do some digging to come up with this very simple answer.

jbrown574
  • 99
  • 1
  • 3
  • 10