Jquery editable table

function addpublic() 
{ 
	var data1 = $('#group-create-public').serialize(); 
	$(".group1").show(0); 
	$.ajax({ 
			url:"group-create-code.php", 
			type:"post", 
			data:data1, 
			success:function(da){ 
			var row = "" + document.getElementById('namepb').value + "" + document.getElementById('emailpb').value + ""; 
			$("#publicbody").append(row); 
			$("input[type=text]").val(""); 
			} 
	}); 
	setTimeout(function() { $(".group1").fadeOut(1500); }, 2000); 
} 
function addprivate() {
		 var data1 = $('#group-create-private').serialize(); 
		 $(".group1").show(0); 
		 $.ajax({ 
				 url:"group-create-codeprivate.php", 
				 type:"post", 
				 data:data1, 
				 success:function(da){ 
				 var row = "" + document.getElementById('namep').value + "" + document.getElementById('emailp').value + ""; 
				 $("#privatebody").append(row); 
				 $("input[type=text]").val(""); 
				 } 
		 }); 
		 setTimeout(function() { 
		 $(".group1").fadeOut(1500); }, 2000); 
 } 
 function deletegp(id) {
		 $.ajax({ 
				 url:"delete-member.php", 
				 type:"post", 
				 data:{'id':id}, 
				 success:function(da){ 
				 $("#"+id).hide(0); 
				 } 
		 }); 
 } 
 function editgp(id) {
		 var name = $("#"+id).children('td:first').text(); 
		 var email = $("#"+id).children('td:first').next('td').text(); 
		 var row = ' '; 
		 $("#"+id).html(row); 
 } 
 function updatemember(id) {
		 var name = $("#updatename").val();
		 var email = $("#updateemail").val(); 
		 $.ajax({ 
				 url:"update-member.php", 
				 type:"post", 
				 data:{'id':id,'name':name,'email':email}, 
				 success:function(da){
				 var html = "" + name + "" + email + " "; 
				 $("#"+id).html(html); 
				 } 
		 }); 
 } 
 
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s