jQuery - Two dialog boxes, only one click event is working
<p>I'm using ASP.NET and jQuery.</p>

<p>I have two dialog boxes, each of which have a button with a click event.  </p>

<p>The form started with one, and everything worked fine.  You could enter a fax number, click a button, and stuff would happen.</p>

<p>Adding in the second dialog box caused problems.  The button in the first one just stopped working, but the second one does work.  Can anyone see what I'm doing wrong here?  I'm sure it has something to do with how I'm appending to the form, and that the TrackingWindow is overwriting the FaxesWindow.  I'm just not certain how to get this to work correctly.  The JavaScript is as follows:</p>

<pre><code>        $FaxesWindow = jQuery("#faxesDialog");
        $TrackingWindow = jQuery("#trackingDialog");

        $FaxesWindow.dialog({ height: 285,
            width: 310,
            modal: true,
            bgiframe: true,
            position: ['center', 150],
            autoOpen: false,
            title: 'Enter fax number',
            overlay: { opacity: 0.5, background: 'black' }
        });
        $FaxesWindow.parent().appendTo(jQuery("form:first"));

        $TrackingWindow.dialog({ height: 290,
            width: 310,
            modal: true,
            bgiframe: true,
            position: ['center', 150],
            autoOpen: false,
            title: 'Enter Order Number',
            overlay: { opacity: 0.5, background: 'black' }
        });
        $TrackingWindow.parent().appendTo(jQuery("form:first"));
</code></pre>

<p>Portions of the two user controls are as follows:
FaxesWindow:</p>

<pre><code>&lt;div style="padding-bottom:10px"&gt;
    &lt;table&gt;
        &lt;tr&gt;
            &lt;td&gt;&lt;asp:TextBox ID="txtFax" runat="server"&gt;&lt;/asp:TextBox&gt;&lt;/td&gt;
            &lt;td&gt;
                &lt;asp:ImageButton ID="ibGo" ImageUrl="~/images/btnOk.gif" runat="server" onclick="ibGo_Click" /&gt;
            &lt;/td&gt;
        &lt;/tr&gt;
    &lt;/table&gt;    
&lt;/div&gt;
&lt;asp:UpdatePanel ID="upTed" runat="server"&gt;
    &lt;Triggers&gt;
        &lt;asp:AsyncPostBackTrigger controlid="ibGo" eventname="Click" /&gt;
    &lt;/Triggers&gt;
    &lt;ContentTemplate&gt;
        &lt;!-- snipped for brevity --&gt;
    &lt;/ContentTemplate&gt;
&lt;/asp:UpdatePanel&gt; 
</code></pre>

<p>TrackingWindow:</p>

<pre><code>&lt;div style="padding-bottom:10px"&gt;
    &lt;table&gt;
        &lt;tr&gt;
            &lt;td&gt;&lt;asp:TextBox ID="txtTracking" runat="server"&gt;&lt;/asp:TextBox&gt;&lt;/td&gt;
            &lt;td&gt;
                &lt;asp:ImageButton ID="ibStart" ImageUrl="~/images/btnOk.gif" runat="server" OnClick="ibStart_Click" /&gt;
            &lt;/td&gt;
        &lt;/tr&gt;
    &lt;/table&gt;    
    &lt;br /&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;asp:UpdatePanel ID="upTed2" runat="server"&gt;
    &lt;Triggers&gt;
        &lt;asp:AsyncPostBackTrigger controlid="ibStart" eventname="Click" /&gt;
    &lt;/Triggers&gt;
    &lt;ContentTemplate&gt;
        &lt;!-- Snipped for brevity--&gt;
    &lt;/ContentTemplate&gt;
&lt;/asp:UpdatePanel&gt; 
</code></pre>

<p>Thanks!</p>
