jquery alert plugin , jConfirm
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.
<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
开发者_Python百科 } // 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 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
精彩评论