Created
November 6, 2015 12:46
-
-
Save galpratama/730778e235333d1984eb to your computer and use it in GitHub Desktop.
Rating User UGo
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
// Rating Submit by User | |
$('#ratingForm input').on('change', function() { | |
var button = $(this).find(".rtg"); | |
var data = new FormData(); | |
data.append('id', $('input[name=shopID]', '#ratingForm').val()); | |
data.append('rate', $('input[name=rating]:checked', '#ratingForm').val()); | |
button.prop("disabled", true); | |
console.log($('input[name=rating]:checked', '#ratingForm').val()); | |
$.ajax({ | |
cache : false, | |
contentType : false, | |
processData : false, | |
url : $("#ratingForm").attr("action"), | |
type : "POST", | |
data : data, | |
success : function(data) { | |
var obj = $.parseJSON(data); | |
if(obj.status == 200) { | |
alert('success'); | |
} else { | |
alert(obj.message); | |
} | |
} | |
}) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment