jquery - How to make a POST API call with many (50+) fields -


i have large api call make info on form.

i can't seem figure out best way go sending serialized data api endpoint.

  1. i put fields object in javascript, , pass it
  2. i take model submitted controller, , pass end point

i'm not sure how either.

jquery has built-in method make easy.

$.post("/somepage.asp",$("#theform").serialize()).done(function(){     // done! }).fail(function() {     // went wrong! }); 

it serialize of form fields in form , post them page of choice.

http://api.jquery.com/jquery.post/
http://api.jquery.com/serialze/
http://learn.jquery.com/ajax/ajax-and-forms/


Comments

Popular posts from this blog

php - SPIP: From Tag directly to an article -

jquery - isAjaxRequest always return false -

ruby on rails - In a controller spec, how to find a specific tag in the generated view? -