use shadowbox instead of pop-up confirmation box

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

use shadowbox instead of pop-up confirmation box

cmuench
Hello,
I have a form that I need a confirmation box on.  However I don't want to mess with the processing part of the form.  So I would really like shadowbox to do a confirmation box pop-up for me.  Can I do that?  Here is the javascript I use to do just a plain pop-up box.

[code]
onClick="return confirm('Delete this item?');"
[/code]
Reply | Threaded
Open this post in threaded view
|

Re: use shadowbox instead of pop-up confirmation box

mjijackson
Administrator

Have a look at the simple form example on the demo page. It shows how to use Shadowbox with an external form file. Otherwise, you could always place your confirmation dialog HTML in an inline element on the page, and then display it using the inline content type.

Shadowbox.open({
    player: 'inline',
    content: '#confirm-dialog',
    title: 'Are you sure?'
});

In the above example, the element with id confirm-dialog would hold the HTML for your confirmation dialog.

Reply | Threaded
Open this post in threaded view
|

Re: use shadowbox instead of pop-up confirmation box

cmuench
I don't want to include a form to show in a shadowbox.  I want a shadowbox to pop-up after I hit submit from the form on the page.  Then shadowbox asks me are you sure?  Yes allows the form in the background to continue proccessing.  No takes me "back" to the original page.
Reply | Threaded
Open this post in threaded view
|

Re: use shadowbox instead of pop-up confirmation box

Wizzud
You missed the point of what Michael was telling you.
He's pointed you towards 2 possible ways of achieving what you want.

In the first one, the important word is external, not the fact that the example uses a form. Your HTML - that displays your question and provides a means to select either Yes or No - may or may not involve a form, or form-type elements (like input buttons). That is entirely up to you.

The second method is to call inline HTML by given a player type of inline and referencing the id of an element that contains your question/answer HTML within your page (usually in a hidden div). Once again, the HTML that you choose to use to ask your question and determine the answer is up to you.

Whichever method you implement, and whatever HTML you use for the question/answers, you are going to need some script to handle the response - to capture, and subsequently act on, the answer chosen by the user; and to close down shadowbox. You will also need to decide how (or if) you want to cope with the user simply closing the shadowbox without answering your question : disable overlay clicks to close? remove the navigation? disable keys for closing (like escape)?
Combine literacy with curiosity and a whole world of information opens up to you