196 comments found.
Is it possible to have the msgBox close itself? For example, if someone clicks something, I only want the warning to show for like 3 seconds before closing itself… like popping a msgBox with an ajax-loading gif?
$.msgbox("Loading... please wait");
setTimeout(function() {
$.MsgBoxObject.close();
}, 2000); // in ms
Hello,
I have trouble just from the begining. I can’t make it even show the alert box. I have followed everything in the documentation even watching your source code and i don’t know to to continue, could you please help me? There is my head source code if it’ll help you. Thank you so much…
my e-mail is scubyart@gmail.com
<head>
<base href="<?php echo$base;?>" />
<meta content="text/html;charset=UTF-8" http-equiv="Content-Type" />
<meta name="author" content="Jakub Frasunek || www.scuby.cz" />
<title>Pixel Administration Tool</title>
<link href="../css/ico.ico" rel="shortcut icon" />
<script src="../js/prototype.js" type="text/javascript"></script>
<script src="../js/scriptaculous.js?load=effects,builder" type="text/javascript"></script>
<script src="../js/lightbox.js" type="text/javascript"></script>
<script src="../js/floating.js" type="text/javascript"></script>
<script src="../fce.js" type="text/javascript"></script>
<link href="stylesheet.css" rel="stylesheet" media="screen" type="text/css" />
<link href="../lightbox.css" rel="stylesheet" media="screen" type="text/css" />
<link href="css.css" rel="stylesheet" media="screen" type="text/css" />
<script type="text/javascript">
function setFixed(element,yOffser){Event.observe(window,'scroll',function(){var scrollXY=getScrollXY();if(scrollXY[1]>624){element.style.position='absolute';element.style.marginTop='0px';element.style.marginBottom='0px';element.style.top=scrollXY[1]+'px';}else{element.style.position='absolute';element.style.marginTop='0px';element.style.marginBottom='0px';element.style.top='575px';document.getElementById('tabulka').style.marginTop='68px';}});}
function getScrollXY(){var scrOfX=0,scrOfY=0;if(typeof(window.pageYOffset)=='number'){scrOfY=window.pageYOffset;scrOfX=window.pageXOffset;}else if(document.body&&(document.body.scrollLeft||document.body.scrollTop)){scrOfY=document.body.scrollTop;scrOfX=document.body.scrollLeft;}else if(document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop)){scrOfY=document.documentElement.scrollTop;scrOfX=document.documentElement.scrollLeft;}
return[scrOfX,scrOfY];}
function ms(){
$.msgbox("Your Message.");
}
</script>
<script src="javascript/jquery.min.js" type="text/javascript"></script>
<script src="javascript/msgbox/jquery.msgbox.js" type="text/javascript"></script>
<link href="javascript/msgbox/jquery.msgbox.css" rel="stylesheet" type="text/css" />
</head>
Awesome, Thank you so much for your support.
Hi everyone,
I’m having a problem, I want to send the values captured into the text fields inside the msgbox via POST .
Is posible that you guys could help me with this issue?
That’s my crappy code:
<a href="javascript:$.msgbox('', { type: 'prompt', inputs: [{type: 'text', label: 'UserID:', required: true}, {type: 'password', label: 'Password:', required: true}], buttons: [{type: 'submit', value: 'Submit'}, {type: 'cancel', value: 'Cancel'}] }, function(user, password) { if (user) { //CODE HERE } });">Sign-In</a>
I’m new in this JavaScript thing and I don’t know how to assign an ID or something in order to send the info to another page.
Thank you so much for your help!
Replied, check your email.
On Chrome 12, the buttons appear to be unstyled.
Hi, the preview is too old, the new version fix the button problem. I’m uploading it now and it will be available soon. Regards.
Hola. Quizás no quedo claro un punto de mi consulta anterior: funcionamiento con IE9 .
Es curioso porque a mostrarse el mensaje, el fondo cubre el fonde de pagina, cubre el div,..... pero no si existe una tabla con un background que sea una imagen. Sin embargo en Firefox si lo cubre bien, y tu antigua aplicacion sexylightbox si lo cubre. Puedes comprobarlo en www.erodetraining.es/inscripcion.php nada mas cargar la página, y si aceptas, en el pide, justo en el centro, un tema de certificación, con sexy lo hace bien. He probado a actualizar el jquery pero no hay diferencia.
Hola,
¿Podrías ser más claro sobre cuál es el error? Y sobre qué sistema operativo y que versión exacta estás corriendo el ejemplo, además de cuáles son los pasos precisos a seguir para reproducir el error. Estoy viendo la URL que me enviaste y se ve hermoso en mi Internet Explorer 9.
Saludos.
Gracias, ya lo he solucinado, al menos parcialmente. Desde actionscript el código es:
getURL("javascript:MsgBoxDelegate('linea1<br />linea2...', parameter)");
y en el html, para leer la llamada:
function MsgBoxDelegate(caption){
$.msgbox(caption, { type : parameter });
}
Al principio se puso tonto pero acabé dando con la forma correcta. Muchas gracias.
Por cierto, es una pena pero con IE9 , aunque el swf esté como transparente, funciona mal, si se muestra sobre el flahs el mensaje, pero no el fondo con transparencia, que se queda por detrás.
Hi. Congratulations for your work. I want to call msgbox from Flash actionscript, to show forms errors (I can write a similar effect on flash, but only cover animation, so I orefer msgbox than cover all the screen). Can you help me? Thanks
En tu lengua, antes lo puse en ingles por educación para quienes no lo hablan.
Felicidades por tu trabajo, una gran ayuda. Necesito llamar msgbox desde actionscript para mostrar los errores de los formularios. Puedo programar algo similar en Flash, pero solo cubre la animación mientras que tu script cubre el 100% de la pantalla. ¿puedes ayudarme? ¿Como llamo a la función? Gracias
Hola, no te sabría decir muy bien porque nunca trabajé con Flash, pero tengo entendido de que deberías ejecutar el siguiente código:
getURL("javascript:jQuery.msgbox('Hola!!!');");
o algo más avanzado como esto:
getURL("javascript:jQuery.msgbox('¿Deseas realmente eliminar esta celda?', {type : 'confirm',buttons : [{type: 'submit', value:'Si!'},{type: 'cancel', value:'No, Cancelar'}]});");
Es el mismo código que devuelve el generador, sólo que cambias $ por jQuery y lo metes todo en el mismo renglón:
getURL("javascript:CODIGO");
Saludos.
Is there any way to add a select box?
No, it only has textbox fields.
Hi, i have a small question, i can’t get cyrilik characters to be displayed correctly… Have you any idea ?
Excellent file! It was really easy to edit and extend this plugin of yours!
Great work! Keep them coming 
This author doesn’t seem to be too supportive.
1/ Wheen I fill out all fields and click on OK, MsgBox will ask for confirmation – it can be alert.
2/ Wheen i submit form, page with results come up on screen another instance of mgbox so i need this msgbox to have button try again, theen it will load first instance of MsgBox.
3/ I need fields
Does anyone made such changes ?
Is it possible to add select field ?
Hi, How can i setup the position of the popup widow? I want it to show up a bit upper. Thanks
Awesome job, really easy to use!
But I have one question: What is the function to make the box shake? I want to use a prompt box to get user/pass, and then shake if the user/pass is invalid. Thanks 
jQuery.MsgBoxObject.shake()
I must admit this is a fantastic prodult having lots of fun with it
Features ive added for my personal use are
Ajax Form
Hidden inputs
and im just about to add a function that allows me to build inputs from a custom array 
Great job well done 
Hi,
There is a little problem with the message boxes when calling a message box from inside a message box’s callback function that is executing an ajax function.
i.e. lets cosider the next code:
$.msgbox('Question', {
type : 'confirm',
buttons : [
{type: 'submit', value:'Yes'},
{type: 'cancel', value:'No'}
]}, function(buttonPressed) {
if (buttonPressed == 'Yes')
{
$.ajax({
type: "POST",
url: location.protocol + '//' + location.host + '/whatever',
success: function(msg){
$.msgbox(msg);
}
});
}
});
In this example if we press YES on the first message box the AJAX will get executed and then if the ajax would success a second msgbox should pop out. The problem is that the second message box will no longer overlay the screen (gray) and no any other message box that will pop after it, even though the links / buttons etc in the background of the message box are still not click able.
Is this a glitch of this plugin or a problem of jQuery or the browsers?
This was tested on FireFox 4.0.1 and Chrome 11.
Muchas gracias!
Hola, felicidades por el script, no sabía que eras argentino. Una consulta: ¿Se podría implementar para que cargue al iniciar una página?
Muchas gracias.
English:
Congrats for your work, is awesome!
How I can use it to run when you start a page?
Thanks in advance.
Si, tranquilamente podrías poner el msgbox dentro del evento “ready” de jQuery:
jQuery(document).ready(function($) {
$.msgbox("Hola!!");
});
Eso hace que el msgbox se lance al cargar la página.
Saludos.