Aha!  Right you are.  That makes so much sense I can't believe I didn't think
of it before, thanks Erik!

I tried moving the code that attaches the events into a seperate function
that I call *after* the thickbox is created - but the "click" event only
worked on the first element in the thickbox - but not on the other two
following it.  This seems like it would work to me, but maybe it's a race
condition?  Any thoughts?  Here's the function that I call after the
thickbox is created and displayed:

function doBinding()
        {
                $("#lnkForgot").click(function() {
                        $("#divForgot").slideDown(500);
                        return false;
                });
                $("#lnkCancelForgot").click(function() {
                        $("#divForgot").slideUp(500);
                        return false;
                });
                $("btnLoginButton").click(function() {
                        $("#hdnMode").val("login");
                });
        }

For those familiar with ASP.NET, any ideas on a different way of doing this
(other than having the content hidden elsewhere on the page like I'm doing
now)?  As far as I can tell, I can't go and grab the html from another ASPX
page and display it - because then I would have a nested form tag. 
Currently, I'm creating a form in a User Control, then I include the user
control on a page and hide it.  When the user clicks the login link, I
display that form in the thickbox.

Thanks,
Chad


Erik Beeson wrote:
> 
> Without even looking at the code, I would guess you're using the thickbox
> to
> display content that you have elsewhere on the page? If so, that would be
> the source of the problem. Cody's thickbox shows a copy of the elements
> for
> displaying inline, and the event handlers aren't applied to the copies. I
> ran in to this exact same thing trying to do a login box. Possible
> solutions
> are: use a different light box, hack up the thickbox code, or have your
> login page be a separate page that the thickbox loads through an iframe.
> 
> --Erik
> 
> On 11/11/06, leftend <[EMAIL PROTECTED]> wrote:
>>
>>
>> Hello, I'm running into a case where the "click" event is not working on
>> one
>> of my pages.  The strange thing is that I know the code is alright,
>> because
>> I've pulled it out and used it on test pages.  It's kind of hard to
>> explain,
>> so I'll jump right to a url:
>>
>> http://www.the-in.com/dev/Learn_UserProfile.aspx
>>
>> If you click the "Login" link in the upper-right - I'm successfully
>> popping
>> up a thickbox with a login form in it.  My main question revolves around
>> the
>> "Forgot your password?" link in the thickbox.  When you click on it, it
>> should slide down a hidden div that allows you to get your password - but
>> no
>> dice...
>>
>> Here's what the link looks like:
>> # Forgot your password?
>>
>> And here's where I wire up the click event:
>> $(document).ready(function() {
>>                 $("#lnkForgot").click(function() {
>>                         $("#divForgot").slideDown(500);
>>                 });
>>         });
>>
>> Because this same code has worked in my test pages, I would guess the
>> issue
>> lies with some other js/html on the page, but I'm not sure how.  But then
>> again, thickbox is working fine... so maybe not?
>>
>> Please help!!
>>
>> Thanks,
>> Chad
>> --
>> View this message in context:
>> http://www.nabble.com/click-event-not-working---tf2612228.html#a7290742
>> Sent from the JQuery mailing list archive at Nabble.com.
>>
>>
>> _______________________________________________
>> jQuery mailing list
>> [email protected]
>> http://jquery.com/discuss/
>>
> 
> _______________________________________________
> jQuery mailing list
> [email protected]
> http://jquery.com/discuss/
> 
> 

-- 
View this message in context: 
http://www.nabble.com/click-event-not-working---tf2612228.html#a7311920
Sent from the JQuery mailing list archive at Nabble.com.


_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to