Jump to content

Recommended Posts

I am looking for a way to customize javascript alert boxes as far as color and style. Basically to make it look nice and user friendly . I have tried jquery.alerts but to no avail.Probably i am implementing it wrong. i am tryn to verify a radio button has been checked and then based on th eone checked display an alert.

 

 

function checkplan(){

 

if (document.step1.plan[0].checked == true)

{

 

 

$(document).ready( function() {

 

$("#alert_button").submit( function() {

jAlert('This is a custom ', 'Alert Dialog');

return false;

});

 

 

 

});

 

}

}

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/239509-custom-javascript-alert-box/
Share on other sites

Your code:

function checkplan() {
    if (document.step1.plan[0].checked == true) {
        $(document).ready(function () {

            $("#alert_button").submit(function () {
                jAlert('This is a custom ', 'Alert Dialog');
                return false;
            });
        });
    }
}

 

as Omirion said it's a bit pointless to do a domready check inside the function the other way around would be more logical like so:

$(document).ready() {
    // your function call here
    checkplan();
}

 

If I may ask what is this suppose to do?

document.step1.plan[0].checked == true

I'm pretty sure you could write it neater using the jQuery selector.

 

You might also want to take a look at jquery ui

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.