This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I call the above function on the click event of a button. It displays a form in a dialog (#dialog-form). After closing the form the dialog won't open when this function is called subsequent times. Looking at the console.log() statements, it always finds the $(tab) but the #dialog-form comes back empty. To make matters worse, it is sporadic. The other day, this was working just fine. I could get the dialog to display any time I wanted. Today? Only once.
A tad bit more information. $(tab) is looking for the ID of a jQuery UI tab element, and on this tab I have the DIV#dialog-form. In firebug, I can type console.log($('#dialog-form')) and I get my DIV element back. If I do a search off the $(tab) it comes back . This only occurs after I've dismissed the dialog the first time. Prior to showing the dialog, I can find the element no problem.
My guess is that when the Dialog is closed, the DIV#dialog-form isn't a child of $(tab) anymore.