Home > Jquery, Scripts > Jquery serialize form id

Jquery serialize form id

Khi các bạn submit form bằng method serialize của jquery và chỉ định form id thì làm như sau:


form id="frm_contact"
.... html input tag

Jquery javascript:


var f = $("form#frm_contact");
            
			$.ajax({ type: "POST",   
				 url: http://www.panpic.vn/process.php,
				 async: false,
				 data: f.serialize(),
				 success: function(text){ 
					alert(text);
				 }
			});	

Chúc thành công
nhantam
Web developer team in Vietnam

Advertisements
  1. No comments yet.
  1. No trackbacks yet.

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

%d bloggers like this: