jQuery msgbox Plugin Examples

Example 1

To simply call MsgBox like you would a regular alert command:

$.msgbox({ 'message':'The selection includes process white objects. Overprinting such objects is only useful in combination with transparency effects.' });

Example 2

To add a couple extra buttons with different values:

$.msgbox({ 'message' : 'Are you sure that you want to permanently delete the selected element?', 'type' : 'confirm', //'buttons' : [{'type' : 'yes', 'value': 'Yes'}, {'type' : 'no', 'value': 'No'}, {'type' : 'close', 'value': 'Cancel' }] 'callback' : function(result){ alert( result); } });

Example 3

info type.

$.msgbox({ 'message' : 'jQuery is a fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development.', 'type' : 'info' });

Example 4

error type.

$.msgbox({ 'message' : 'An error 1053 ocurred while perfoming this service operation on the MySql Server service.', 'type' : 'error' });

Example 5

prompt type.

$.msgbox({ 'message' : 'Insert your name below:', 'type' : 'prompt', 'callback' : function(result){ alert( result); } });

Advanced Examples

prompt type. multi inputs

$("#advancedexample").click(function() { $.msgbox({ 'message' : 'In order to process your request you must provide the following', 'type' : 'prompt', 'inputs' : [{'type' : 'text', 'label' : 'Insert your Name:', 'name' : 'user_name', 'value' : "George" }, {'type' : 'password', 'label' : 'Insert your Password:','name' : 'password'}], 'buttons' : [{'type' : 'yes', 'value' : 'OK'},{'type' : 'close', 'value' : 'Exit'}], 'callback' : function(result){ for(var i in result) { alert( result[i].name + ':' + result[i].value ); } } }); });