views:

166

answers:

1

Hi i got this script which works perfect when i am not using jquery's alert plugin. But i need to use alert plugin and after learning from a tutorial i implemented it. But the script does not seem to work. Can you suggest where i am wrong..Thanks

<script type = "text/javascript">

$(document).ready(function() {

    var pos = $("tr.verify").attr('id');

    var frmId = $('#'+ pos).find("form").attr('id');

    $('#'+ frmId).click(function(event) {

    jConfirm('Are you sure you want to verify?', 'Confirmation Dialog', 
    function(r) {

        if(r==true)
        {   

        $.ajax({
        type: "POST",
        url: "verify.php",
        data: $("form#" + frmId).serialize(),
        success: function(msg){

            if(msg.indexOf("success") > -1)
            {
                //success in registaration
            var inputsub = $("form#" + frmId).find('input[type=submit]').attr('id');
            $('#' + inputsub).val('verified').attr('disabled','disabled');

            } //end of if
            else if(msg.indexOf("Error") > -1)
            {

                alert(msg);
            } //end of else if

            } // end of success event



            }); //end of ajax code



    }  // end of if r == true
    return false;

    }); //the alert code

    }); //end of form submit

    }); //Main document ready code

</script>

Thanks in advance.

A: 

Thanks zakalwe for your reply. I figured it out what was wrong.. Reading the documentation i found out that i was using the older version of jQuery viz 1.2.2 and the plugin required 1.2.6 or later. This was a silly mistake which cost me 3 hrs. Anyways worth taking note of..thanks

noobcode