Created
August 30, 2013 20:32
-
-
Save eventuallyc0nsistent/6394000 to your computer and use it in GitHub Desktop.
ajax dialog post
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var commentPolicy = function(username,category){ | |
var username = username; | |
var category = category; | |
$('.icon-comment').click(function() { | |
var id = $(this).attr('name'); | |
$("#dialog .policy-comment").val(''); | |
$("#dialog").dialog({ | |
title: id+" comment", | |
buttons: [ | |
{ | |
text : "Submit", | |
click: function() | |
{ | |
var comment = $("textarea.span3.policy-comment").val(); | |
$.ajax({ | |
context : this, | |
url : 'include/sql/admin_policy_comment.php', | |
type: 'POST', | |
data : {policy_id : id,username : username ,comment:comment,category:category}, | |
success : function (response) { | |
$("#dialog .policy-comment").val(''); | |
$("#dialog").dialog("close"); | |
$('#dialog').append(response); | |
} | |
}) | |
} | |
} | |
], | |
}); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment