views:

40

answers:

3

hi. im a backend programmer who wants to have a window that appears in front of the current window when clicking "register".

so that you dont have to redirect to another page.

i think u guys know what i mean.

how do i do that? is it with jquery or javascript? is ajax involved?

and what is that kind of popup box called?

A: 

I believe you're referring to a modal form. You can search for modal popup javascript. There is a good javascript component called Lightbox that will help as well.

EDIT:

I mentioned Lightbox, but Lightbox Gone Wild is the one I meant. As others have pointed out, using a modal tool like this all you do is write the html you want to be displayed in the modal popup. That link is a good tutorial on the concept and explains things well.

Sam
no its not an image i want to popup. i want a register box to popup where u enter your information and then you click Register and you have registered.
ajsie
A: 

You want to write a div into your HTML that contains your login fields (i.e. the popup window). Set it to position:absolute; and position with CSS so it floats above the page contents and doesn't interrupt the flow when it appears. Get it all nice and positioned where you want it, then set it to display: none; so it will wait for javascript to make it appear.

Then (using jQuery), write something like this:

$('#register').click(function() {
    $('#popup').show();
});

where #register is whatever gets clicked (can be most anything with id="register").

What happens whenever that form is submitted is up to you, and not any different from the options you'd have with any other HTML form. jQuery can help with AJAX if you decide to go that route and not send the surfer to another page to process the form.

carillonator
+2  A: 

It can be done using quite a few totally different approaches. As Sam said it's the concept of modal boxes.

You could do it completely on the client side using CSS and JavaScript (alternative), or via AJAX and some third-party libs.

Try being a bit more specific - what's the the backend/frontend environment? Is performance an issue (eg. minimal client-server communication)?

Vuk