Hi all I have a question regarding Facebox. When I click a certain link on my page, the Facebox modal window opens just fine. But inside this modal window I'd like to have a form that users can submit. When the users click the submit-button, the whole page refreshes, and my Facebox-window is closed. This makes sense to me, but I'd like it to work differently. I want to give the user a confirmation, inside of the modal window, after they have submitted the form. So when a user clicks the submit-button, a confirmation should be showed inside og the modal-window. Anybody know if this is possible?

I hope that you understand my question :)

Best regards Kim Andersen

1 answer


Your best shot is to use ajax. Bind a JavaScript that listens to when the form i submits, then intercepts the form submit (aborts the posting), handles the request itself (through ajax), and shows a confirmation for the user, then closes the window (or gives the user the means to to that, Ie "Close window" link).

I've set up and ajax example with jQuery here. With a phps-file here.

The example doesn't use a dialog box but you can easily put the form anywhere you like.

Answered about 9 years ago by Jens Hedqvist