-2

I have a form with 100 fields ,how do i post the data to a php using ajax with out refreshing the page,also i do not want to concatenate the field values without getelementbyid in the xmlhttprequest.

Thanks

mark rammmy
  • 1,478
  • 5
  • 27
  • 61
  • Pick a JavaScript library, use its form serialization and AJAX methods. – Dan Grossman Jul 29 '11 at 10:14
  • Or iterate through the dom and get all the values of the form fields and make a string... you can have it as a function... please refer this link http://stackoverflow.com/questions/169506/obtain-form-input-fields-using-jquery – Karthik Jul 29 '11 at 10:18

1 Answers1

2

in jQuery could be something like

$.post("/path", $("#form-id").serialize(), function(ev){
  alert("done!");
});
lcapra
  • 1,420
  • 16
  • 18