I am using this particular way of sending the data via Ajax and I am not able to get a success message using this. Is there another way to send multiple data after doing $('form').serialize()
and also get a success message back. The code that I am using is mentioned below.
<script>
$(document).ready(function(){
$('#sub').click(function(event){
event.preventDefault();
$.ajax({
method:"POST",
url:"main_class.php",
data:$('form').serialize() + "&submit=submit"
});
});
});
</script>