Code

Discussion on jQuery MsgBox

Discussion on jQuery MsgBox

Cart 1,634 sales

aeroalquimia does not currently provide support for this item.

196 comments found.

Just wanted to confirm before purchasing, as your reply to @seyyedhamed was a little unclear – are you saying the ‘No’ you cannot specify the width of a single instance of the msgBox ? We’re not worried about his other question.. but, one thing we do need is the ability to change the width of the msgBox for a couple different instances – eg. forms would be wider than dialogs/messages.. please confirm whether we can or cannot specify a width per instance.

I’ll wait to purchase until you reply. Thanks

Any word on whether the per instance width option will be included in a near future release? I want to know whether I should bookmark this or continue my search.. thanks

No, sorry. I’m working on other things.

No worries then.. we’ll keep searching as we need that ability and prefer to use a script that is being actively developed and supported.. thanks again

Just purchased. Very nice. Without hacking up things too much is their a method for using a select menu in place of an input box on a confirm? I want to use this as a confirm for my ajax call when a user adds an item to their shopping cart. The confirm will prompt the user whether they want to add the item to their cart and the drop down the qty options they can select.

Hello,

I just purchased your MsgBox and I love it.

I’ve got 2 questions:

1- how can I specify the properties of each instance. e.g background or width.

2- how to hide MsgBox by clicking any where out of MsgBox area.

Thanks in advanced Seyyed Hamed

Hi, I’m sorry but you can’t.

Tank you for such a beautiful work. I need some help making it work on my site, since this is my first time try something like this, here is my code:

function ToggleCertificateAmount() { if($(’#CustomAmountVisible label’).css(‘display’) != “none” && $(’#AmountSelectVisible label’).css(‘display’) != “none”) { if($(’#custom_amount’).attr(‘checked’) true) { $('#SelectAmount').hide(); $('#CustomAmount').show(); } else { $('#SelectAmount').show(); $('#CustomAmount').hide(); } } }

function CheckGiftCertificateForm() { if($('#to_name').val() ””) { alert(‘ %LNG_EnterValidCertificateToName %‘); $(’#to_name’).focus(); $(’#to_name’).select(); return false; } }

if($('#to_email').val()  "" || $('#to_email').val().indexOf('.')  -1 || $('#to_email').val().indexOf('@')  -1) {
    alert(' %LNG_EnterValidCertificateToEmail %');
    $('#to_email').focus();
    $('#to_email').select();
    return false;
}
if($('#from_name').val()  "") {
    alert(' %LNG_EnterValidCertificateFromName %');
    $('#from_name').focus();
    $('#from_name').select();
    return false;
}
if($('#from_email').val()  "" || $('#from_email').val().indexOf('.')  -1 || $('#from_email').val().indexOf('@')  -1) {
    alert(' %LNG_EnterValidCertificateFromEmail %');
    $('#from_email').focus();
    $('#from_email').select();
    return false;
}
if($('#message').val().length > 200) {
    alert(' %LNG_GiftCertificateMessageTooLong %');
    $('#message').focus();
    $('#message').select();
    return false;
}
if($('#CustomAmountVisible').css('display')  "none") {
    if($('#selected_amount').val()  '') {
        alert(' %LNG_SelectValidGiftCertificateAmount %');
        $('#selected_amount').focus();
        return false;
    }
}
else if($('#AmountSelectVisible').css('display')  "none") {
    if(isNaN($('#certificate_amount').val()) || $('#certificate_amount').val() == 0) {
        alert(' %LNG_EnterValidGiftCertificateAmount %');
        $('#certificate_amount').focus();
        $('#certificate_amount').select();
        return false;
    }
    else if(' %GLOBAL_GiftCertificateMinimum %' != 0 &&  %GLOBAL_GiftCertificateMinimum % > $('#certificate_amount').val()) {
        alert(' %LNG_EnterGiftCertificateValueBetween %');
        $('#certificate_amount').focus();
        $('#certificate_amount').select();
        return false;
    }
    else if(' %GLOBAL_GiftCertificateMaximum %' != 0 && parseFloat($('#certificate_amount').val()) >  %GLOBAL_GiftCertificateMaximum %) {
        alert(' %LNG_EnterGiftCertificateValueBetween %');
        $('#certificate_amount').focus();
        $('#certificate_amount').select();
        return false;
    }
}
else {
    alert(' %LNG_SelectValidGiftCertificateAmount %');
    $('#selected_amount').focus();
    return false;
}
if($("#expiryInfo").css('display') != "none" && $('#agree').attr('checked') != true) {
    alert(' %LNG_PleaseAgreeGiftCertificateTerms %');
    $('#agree').focus();
    $('#agree').select();
    return false;
}
if($('#agree2').attr('checked') != true) {
    alert(' %LNG_PleaseAgreeGiftCertificateTerms %');
    $('#agree2').focus();
    $('#agree2').select();
    return false;
}
if($('#themeSelect').css('display') != "none" && !$('.themeCheck:checked').length) {
    alert(' %LNG_SelectValidGiftCertificateTheme %');
    return false;
}
return true;

function UpdateMessageRemaining(event) { var remaining = 200 – $(’#message’).val().length; if(remaining >= 0) { $(’#remaining’).html(remaining); } else { $(’#remaining’).html(‘0’); if(typeof(event) != “undefined”) { if(event.keyCode != 8) { event.preventDefault(); return false; } } } }

function PreviewGiftCertificate() { if(CheckGiftCertificateForm() == false) { return false; } var l = (screen.availWidth/2)-580; var t = (screen.availHeight/2)-220; var win = window.open(‘ %GLOBAL_ShopPath %/pagos.php?action=preview&’$(’#frmGiftCertificate’).serialize(), “imagePop”, “toolbar=0,scrollbars=1,location=0,statusbar=1,menubar=0,resizable=1,width=580,height=220,top=”+t”,left=”+l); win.focus(); }

$(document).ready(function() { ToggleCertificateAmount(); $(’#message’).keyup(function(e) { return UpdateMessageRemaining(e); }); UpdateMessageRemaining(); });

thank you

Revised. Sorry this is the code.

function validate_form ( )
{
    if ( document.main_form.firstname.value  "" )
    {
        $.msgbox("Please fill in your first name.", {type:"error"});
        return false;
    }
    if ( document.main_form.lastname.value  "" )
    {
        $.msgbox("Please fill in your last name.", {type:"error"});
        return false;
    }
    if ( document.main_form.email.value.search(emailRegEx)  -1 )
    {
        $.msgbox("Please fill in your email.", {type:"error"});
        return false;
    }
    if ( document.main_form.phone1.value  "" )
    {
        $.msgbox("Please fill in your phone number.", {type:"error"});;
        return false;
    }
    if ( document.main_form.mobile1.value  "" )
    {
        $.msgbox("Please fill in your mobile number.", {type:"error"});
        return false;
    }
    if ( document.main_form.creditrating.value  "" )
    {
        $.msgbox("Please select your credit rating.", {type:"error"});
        return false;
    }
    if ( document.main_form.debt_currentmortgage.value  "" )
    {
        $.msgbox("Please select your current mortgage balance.", {type:"error"});
        return false;
    }
    if ( document.main_form.property_estimatedvalue.value  "" )
    {
        $.msgbox("Please select your estimated property value.", {type:"error"});
        return false;
    }
    if ( document.main_form.employment_income.value  "" )
    {
        $.msgbox("Please select your income level.", {type:"error"});
        return false;
    }
    if ( document.main_form.postal1.value  "" )
    {
        $.msgbox("Please enter your postal code.", {type:"error"});
        return false;
    }
    if ( document.main_form.dobyear.value  "" )
    {
        $.msgbox("Please fill in your birth year.", {type:"error"});
        return false;
    }
    if ( document.main_form.dobmonth.value  "" )
    {
        $.msgbox("Please fill in birth month.", {type:"error"});
        return false;
    }
    if ( document.main_form.dobday.value == "" )
    {
        $.msgbox("Please fill in your birth day.", {type:"error"});
        return false;
    }
}
$.msgbox("Submitting. Please wait...", {type:"info"});
return true;

I can not get the last message to fire on submit of the form.

function validate_form ( )
{
    if ( document.main_form.firstname.value  "" )
    {
        $.msgbox("Please fill in your first name.", {type:"error"});
        return false;
    }
    if ( document.main_form.lastname.value  "" )
    {
        $.msgbox("Please fill in your last name.", {type:"error"});
        return false;
    }
    if ( document.main_form.email.value.search(emailRegEx)  -1 )
    {
        $.msgbox("Please fill in your email.", {type:"error"});
        return false;
    }
    if ( document.main_form.phone1.value  "" )
    {
        $.msgbox("Please fill in your phone number.", {type:"error"});;
        return false;
    }
    if ( document.main_form.mobile1.value  "" )
    {
        $.msgbox("Please fill in your mobile number.", {type:"error"});
        return false;
    }
    if ( document.main_form.creditrating.value  "" )
    {
        $.msgbox("Please select your credit rating.", {type:"error"});
        return false;
    }
    if ( document.main_form.debt_currentmortgage.value  "" )
    {
        $.msgbox("Please select your current mortgage balance.", {type:"error"});
        return false;
    }
    if ( document.main_form.property_estimatedvalue.value  "" )
    {
        $.msgbox("Please select your estimated property value.", {type:"error"});
        return false;
    }
    if ( document.main_form.employment_income.value  "" )
    {
        $.msgbox("Please select your income level.", {type:"error"});
        return false;
    }
    if ( document.main_form.postal1.value  "" )
    {
        $.msgbox("Please enter your postal code.", {type:"error"});
        return false;
    }
    if ( document.main_form.dobyear.value  "" )
    {
        $.msgbox("Please fill in your birth year.", {type:"error"});
        return false;
    }
    if ( document.main_form.dobmonth.value  "" )
    {
        $.msgbox("Please fill in birth month.", {type:"error"});
        return false;
    }
    if ( document.main_form.dobday.value == "" )
    {
        $.msgbox("Please fill in your birth day.", {type:"error"});
        return false;
    }
}
$.msgbox("Submitting. Please wait...", {type:"info"});
        return true;
});

Excelente script hermano argentino! Ahora ya no me siento solo jajaja

Abzo!

Gracias che :)

Purchased the item yesterday. Already implemented it. Works flawlessly. Nicely done bro. keep up the good work. :)

One more question. I use Interface elements for jQuery http://interface.eyecon.ro/download for a drag an drop menu

This gives a conlict with MsgBox. No js errors but after a first click the shake doesn’t work but I see the error dialog. After clicking on cancel the popup dissapears as it should be but after clicking again without an page refresh the dialog doesn’t appear only the dimming.

Any lights on this problem ?

Thanks (tested with 1.3.2 and 1.4.2)

One question I just want an alert after an GET param (php)

Now I have

if ($_GET['error'] != '' && $_GET['error'] == 1) { echo '<script type="text/javascript">alert("here the textscript>'; }

But how can I put in here the

$.msgbox(“Here the text{type: “error”});

Thanks for looking in
if ($_GET['error'] != '' && $_GET['error'] == 1) { echo '<script type="text/javascript">jQuery(document).ready(function($){ $.msgbox("HERE YOUR MSG"); });</script>'; } 

It looks like a decent plugin.. but when you view the demo on a Mac (OSX 10.5.8 using FF3 .6.10) the buttons on the modals are default browser styled buttons – no slick looking CSS styling/images are applied. :( Take a look at a screen capture: http://gigashares.net/r5wfl8u2lwcd.html

Anyway you can address this issue, as it seems to have been posted a few times within these comments ? If so,. then we’d consider purchasing it.. but, we need to make sure the UI elements are as consistent as possible and the bugs are being addressed quickly when they arise (all new software and scripts have bugs, to some degree – what’s more important is that they are addressed quickly and accurately by the developer than not having bugs at all) If you need any help testing on the Mac OS I ’d be happy to help in any way I can.. Thanks

Hi,

I am planning to purchase but before that I wanted to know the following.

1. Can I use this to display error message from asp.net server code. I have no button or links to attach it to. like.. msgbox(“VALID DATE OF BIRTH IS REQUIRED ”) or Page.ClientScript.RegisterStartupScript(Page.GetType (), “clickLink”, “msgbox()”, true); 2. Will it work inside of a ajax modal popup.

Thanks Suresh

I don’t know how asp works, but you can fire the msgbox when the page loads:

jQuery(document).ready(function($) {
  $.msgbox("VALID DATE OF BIRTH IS REQUIRED");
});

If I buy a regular license I get a minified/packed js or the real thing?

You will get both :)

Maybe i’m doing something wrong but i can’t get the confirm function to execute the given link the normal way when the user clicks yes.

could you explain this to me.

This is what i got :

$(".confirmDeleteTest").click(function(e){
});
if ($(this).attr('title'))
  {
      var question = 'Weet u zeker dat u dit ' + $(this).attr('title').toLowerCase() + ' wil verwijderen?';
  } else {
      var question = 'Weet u zeker dat u deze actie wilt uitvoeren?';
  }
$.msgbox(question, {
  type: "confirm",
  buttons: [
    {type: "submit", value: "Ja, verwijder het bestand"},
    {type: "cancel", value: "Nee, breng me terug naar de site"}
  ]
}, function(result) {
  if (result) {
    var url = $(this).attr('href');
    window.location.href = url;
  }
});
e.preventDefault();
$(".confirmDeleteTest").click(function(e){

  var link = $(this);

  if (link.attr('title')){
    var question = 'Weet u zeker dat u dit ' + link.attr('title').toLowerCase() + ' wil verwijderen?';
  } else {
    var question = 'Weet u zeker dat u deze actie wilt uitvoeren?';
  }

  $.msgbox(question, {
    type: "confirm",
    buttons: [
      {type: "submit", value: "Ja, verwijder het bestand"},
      {type: "cancel", value: "Nee, breng me terug naar de site"}
    ]
  }, function(result) {
    if (result) {
      var url = link.attr('href');
      window.location.href = url;
    }
  });

  e.preventDefault();

});

Thanks works!

Man you are awesome!!!! it works!!!!!!!!!!!! thanks a lot!

Hi there,

i wanted some help. i want to substitute a default popup message from a phpbb board and use your instead.

this is what i’m using now, together with css part for the style./

how can i integrate it with your Mod?

<!-- IF not S_IS_BOT and S_USER_LOGGED_IN and S_USER_PM_POPUP and S_DISPLAY_PM and (S_USER_NEW_PRIVMSG or S_USER_UNREAD_PRIVMSG) -->
    <p class="not_infoPM"><span class="img"></span>* Hello {S_USERNAME} *<a href="{U_PRIVATEMSGS}"> - You have {PRIVATE_MESSAGE_INFO}<!-- IF PRIVATE_MESSAGE_INFO_UNREAD --> and {PRIVATE_MESSAGE_INFO_UNREAD}<!-- ENDIF --></a><span class="close"></span></p>
    <!-- ENDIF --> 
<!-- IF not S_IS_BOT and S_USER_LOGGED_IN and S_USER_PM_POPUP and S_DISPLAY_PM and (S_USER_NEW_PRIVMSG or S_USER_UNREAD_PRIVMSG) -->
<script type="text/javascript">
  jQuery(document).ready(function($) {
    $.msgbox('* Hello {S_USERNAME} *<a href="{U_PRIVATEMSGS}"> - You have {PRIVATE_MESSAGE_INFO}<!-- IF PRIVATE_MESSAGE_INFO_UNREAD --> and {PRIVATE_MESSAGE_INFO_UNREAD}<!-- ENDIF --></a>');
  });
</script>
<!-- ENDIF --> 

:shocked: :shocked: ?

Hi Eduardo,

I use your purchase msgbox but I’m trying to send a hidden field value from a form and it does’nt seem to post correctly. I have notice that when i changed the hidden field for a text type it will works but i need to pass a hidden type. Is this possible ?

Here is my code :

$(’#loginform’).click(function(ev) {

$.msgbox("

Login form

", { type : "prompt", name : "connection", inputs : [ {type: "text", name: "username\", maxlength=\"12", value: "", label: "Username", required: true}, {type: "password", name: "password\", maxlength=\"12", value: "", label: "Password", required: true}, {type: "hidden", name: "ip", value: "56.43.102.34", required: false} ], buttons : [ {type: "submit", name: "submit", value: "Login"}, {type: "cancel", value: "Cancel"} ], form : { active: true, method: 'post', action: 'login.php' } });
ev.preventDefault();
});

Thanks for your help!

Hello,

really really nice lib, works like a charm.

However there is an issue i would like to mention. I have a multi-language website. When i need to translate the website, it’s hard like this:

$.msgbox("Are you sure that you want to activate this account", {
         type: "confirm",
         buttons : [
             {type: "submit", value: "Yes"},
             {type: "submit", value: "No"}
           ]
}, function (result) {
if (result=='Yes') {

look at the line with if result == ‘Yes’

can’t we add some non string values to the buttons so it would be way easier to translate this?

Thanks!

$.msgbox("Are you sure that you want to activate this account", {
         type: "confirm",
         buttons : [
             {type: "submit", value: "Yes"},
             {type: "cancel", value: "No"}
           ]
}, function(result) {
  if (result) {
    // user clicked yes
  }
});

Thank you! :) Please produce more.

Hi and thx for a great script.

How do i implant this to a php variable ?. I have following code, but I can’t get it working.


if($_GET['user'] == 'taken') {
$.msgbox(\'Username is taken, please try again.\',{
  buttons : [
    {type: \'submit\', value:\'Ok\'}
  ]
});
}

I have also tried:


<script type="text/javascript">
if($_GET['user'] == 'taken') {
$.msgbox(\'Username is taken, please try again.\',{
  buttons : [
    {type: \'submit\', value:\'Ok\'}
  ]
});
}
</script>

Thx in advance :)

  if($_GET['user'] == 'taken') {

    echo '
    <script type="text/javascript">
      $(document).ready(function() {

        $.msgbox("Username is taken, please try again.",{
          buttons : [
            {type: "submit", value:"Ok"}
          ]
        });

      });
    </script>
    ';

  } // end if

Thank you very much, ur the man! =). Works perfectly.

Hello. Well I fixed the problem. You have to add on your Js generator $document.Ready {}. I did this and then it works fine. Regards :-)

by
by
by
by
by
by

Tell us what you think!

We'd like to ask you a few questions to help improve CodeCanyon.

Sure, take me to the survey