196 comments found.
Hola que tal acabo de aquirir, este hermoso articulo, pero mi duda como lo configuro para que pueda enviar algun formulario por mail, estoy intentando de colocarle algun formulario o mejor dicho colocar HTML dentro del pop-up
Hola,
Este script es muy limitado para crear formularios y mostrarlos en el popup. Te convenia mas comprar el lightbox evolution. Sin embargo, puedes crear los inputs comunes y enviarlos a la direccion php que indiques con el siguiente código:
$.msgbox('', {
type: 'prompt',
form: {
active: true,
action: "http://tudominio.com/demo.php"
},
inputs: [
{type: 'text', label: 'Usuario:', required: true, name:"username"},
{type: 'password', label: 'Password:', required: true, name: "password"}
],
buttons: [
{type: 'submit', value: 'Aceptar'},
{type: 'cancel', value: 'Cancelar'}
]
}, function(name, password) {
});
Hey.
Is possible to load these functions on page onload?
Thanks!
how to combine with http://codecanyon.net/item/ajax-translator-revolution-lite-jquery-plugin/246175 ??
hello ,how do I setting the width for msgbox? thank you:)
Excellent script, but I can not “replace” the alert box that used with this code that displays the error after sending the form:
<script language=”javascript” type=”text/javascript”> alert (’<? php echo $ error;?>’); </ script>
There is possibility to use this script to substitur an alert box after sending the form?
hi nice script but i can’t find a way to use one box for many delete confirmations that send the Id of the object being deleted …...
Hi Just used your script again for a website. Keeps amazing me how easy this is to use. One note , i had to have custom buttons which i already made in a button class.
At this moment i had to alter the script and add the class myself, is it possible you can make an option for it where you can give the button a class. Besides that i also like an option to implement a title to the box.
Thnx!
Yes, it’s a good idea.
Excellent! Definitely the best script of its kind that I have seen. Very well crafted and super easy to customize or just use out of the box.
Wow
Thank you.
<a onclick="if (! confirm('An internet connection is required in order to email this PDF')) { return false; }" href="#" rel="email">Email PDF</a>
and also
<a onclick="if (! confirm('An internet connection is required in order to view this external url')) { return false; }" href="http://www.google.com">Visit URL</a>
I only need either Accept or Cancel however the return doesn’t appear to work when i attempt with msgBox.
thanks for your help!
Brian
Because msgbox runs asynchronously.
This can be good a solution:
<a class="plzconfirm" title="An internet connection is required in order to view this external url" href="http://www.google.com">Visit URL</a>
<script type="text/javascript">
jQuery(document).ready(function($) {
$(".plzconfirm").live("click", function(e) {
$.msgbox($(this).attr("title"),{
buttons : [
{type: 'submit', value:'Yes'},
{type: 'cancel', value:'No'}
]
}, $.proxy(function(e) {
if (e) {
window.location = $(this).attr('href');
}
}, this)
);
return false;
});
});
</script>
I apolgise – I fixed the error by loading in the correct order (I was calling the $.msgbox method before the plugin was ctually loaded (which is strange thourhg, as the $.msgbox method was called within the onLoad method, so I thought I was save, but I guess I wasn’t 
Anyway – this got fixed. I have one more question – if we have 3 warnings or errors, is there a way we can easily show them in one dialog? Otherwise it might all become a little annoying, no?
Each time we communicate with the server through Ajax, we might receive messages which will be shown, so we would like them to be shown in one popup if there are more messages to be shown… Is this possible, or is this perhaps planned for a new version of the plugin? 
Hello,
First of all – thanks for a great piece of code. I’m having a problem however. when using
$.msgbox(‘test message’);
it returns the following error:
Uncaught TypeError: Object has no method ‘queue’ $.extend.MsgBoxObject.show17.js:95 $.extend.msgbox17.js:143 $.ui17.js:9 jQuery.Callbacks.firejquery.js:1046 jQuery.Callbacks.self.fireWithjquery.js:1164 jQuery.extend.readyjquery.js:435 DOMContentLoaded
I tried searching this discussion forum, but it doesn’t look as if someone else ran into this one before – do you have any idea?
Outstanding! Converted a project from confirm and ajax modal dialog panels in a very short time.
One question: What are the valid input types we can display on a msgbox? I see the Text type, but what about a Date picker and Combobox?
Thanks
Hi,
It only supports text inputs.
Regards.
Here’s the right code…
<script type=’text/javascript’> function BoxYesNo (message){ BackValue=””; $.msgbox( message, {type: “confirm”,buttons : [ {type: “submit”, value: “Yes”},{type: “submit”, value: “No”} ]}, function(result) { BackValue = result; }); return BackValue; } </script>
Hi,
Very fine job : I love it.
Maybe a detail : I want to have a javascript function : BoxYesNo(), which may return the button pressed. It looks like that :
<script type=’text/javascript’> function BoxYesNo (message){ BackValue=””;
{type: “confirm”,buttons : [{type: “submit”, value: “Yes”},{type: “submit”, value: “No”}]}, function(result) { BackValue = result; }); return BackValue; } </script>
The problem is that the callback function seems to be asynchronous.
Is there a way to fix it ?
Best regards
Christian
The function is asynchronous. I can’t stop the execution of the code waiting the response.
Hola. Alguna vez comentas que para usar el script en HTML5 y con Explorer hay que poner una modificación o script. ¿cual es? ¿Nos puedes dar mas datos?
Hi. Sometimes you said that we must include some script to use youir script on HTML5 and Explorer. Can you give us more information?
P.D.: Puedes contestar en inglés si piensas que por interés general vaya en ese idioma. GraciasHola. No, si alguna vez lo he comentado es porque habrá sido un problema con el DocType.
Si el sitio está bien diseñado en HTML5 y tiene los scripts de compatibilidad de HTML5 con IE6 (por ejemplo boilerplate), entonces no hay ningún problema.
English version: There’s no problem at all 
Best Regards.
Please, update the script to support Jquery 1.7.+
Thanks!
Can you make please an example where message box with one OK button returns button value and after 3 seconds autocloses and returns the same value if button not pressed.
Thank you!
$.msgbox('Would you like a cup of coffee?', {
type : 'confirm',
buttons : [
{type: 'submit', value:'OK'},
{type: 'cancel', value:'Cancel'}
]
}, function(buttonPressed) {
if (buttonPressed) {
msgbox_button_pressed();
}
});
setTimeout(function() {
if ($.MsgBoxObject.visible) {
$.MsgBoxObject.close('OK');
}
}, 3000);
function msgbox_button_pressed() {
alert("Pressed OK");
}
Hi!
How can I specify the width or background color of each instance? Any possibilities to change MsgBoxObject defaults?
Thank you
Can I use this as an exit popup? If I can, how do I set it up to appear when user click the backbutton or when closing the browser?
Thank you
Hi, unfortunately you can’t. Only the “alert” window’s function can do that.
Hi,
Is it possible the error message box to also reset (clear the fields) of a form?