# Using a lightbox as login form

**URL:** <https://www.ruby-forum.com/t/using-a-lightbox-as-login-form/88730>\
**Category:** Rails\
**Created:** [March 13, 2007, 9:36pm UTC](https://www.ruby-forum.com/t/using-a-lightbox-as-login-form/88730 "2007-03-13T21:36:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [March 13, 2007, 9:36pm UTC](https://www.ruby-forum.com/t/using-a-lightbox-as-login-form/88730/1 "2007-03-13T21:36:46Z")

</div>

I’ve been trying to use a lightbox as a login for users. If the user  
successfully logs in, an RJS should be rendered to close the lightbox  
and update some elements on the page. If the login fails, the lightbox  
is updated with a login message and forgot password button.

I haven’t been able to accomplish this with the Lightbox from Particle  
Tree because it appears to escape the rendered JavaScript. I’m not so  
hot with Javascript, so please go easy on me!

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [March 14, 2007, 11:40am UTC](https://www.ruby-forum.com/t/using-a-lightbox-as-login-form/88730/2 "2007-03-14T11:40:16Z")

</div>

On Mar 13, 2007, at 9:35 PM, TomRossi7 wrote:

> I’ve been trying to use a lightbox as a login for users. If the user  
> successfully logs in, an RJS should be rendered to close the lightbox  
> and update some elements on the page. If the login fails, the lightbox  
> is updated with a login message and forgot password button.
> 
> I haven’t been able to accomplish this with the Lightbox from Particle  
> Tree because it appears to escape the rendered JavaScript. I’m not so  
> hot with Javascript, so please go easy on me!

I’d recommend using Redbox instead if possible:

[http://blog.craigambrose.com/articles/2006/09/22/redbox-release-2](http://blog.craigambrose.com/articles/2006/09/22/redbox-release-2)

because it comes with handy Rails helpers.

– fxn

PS: In the current version there’s a gotcha related to Firefox:  
Search for “\>= 0” in that page and apply the minor edition explained  
around in the first occurrence.

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [March 14, 2007, 12:45pm UTC](https://www.ruby-forum.com/t/using-a-lightbox-as-login-form/88730/3 "2007-03-14T12:45:26Z")

</div>

I second the suggestion from xavier, but i also think that your problem  
may  
not be in the lightbox implementation but in the way you call the remote  
action. rjs responses are javascript and as such should not be triggered  
by  
calls that expect html fragments (e.g. calls with an :update option)

hope this helps,

Luca

2007/3/14, Xavier N. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):
