views:

59

answers:

3

Have created simple Ajax enabled contact forms before that have around 12 fields - worked fine....

Now working on a PHP enabled web page for job applications that has around 100 fields.

The ajax technique I was using was to send request via querystrings (&val1=test;&val2=test2 and etc ...)

That is not going to scale very well with larger form with 100+ fields.

Any suggestions to point me in the right direction would be appreciated.

Maybe use jQuery Form plug-in instead? http://jquery.malsup.com/form/#getting-started

Derek

+2  A: 

using REST you could stuff this into a JSON data structure and that should take care of things nicely.

dhoss
+1  A: 

Use POST instead of GET?

wombleton
+2  A: 

Start the form with the Post method

<form action="" method="POST">

Or set your request method to "POST" in the ajax method

$.ajax({
   type: "POST",
   url: "some.php",
   data: "name=John&location=Boston",
   success: function(msg){
     alert( "Data Saved: " + msg );
   }
 });

Or you can collect the form using $(form).serialize()...

$.ajax({
   type: "POST",
   url: "some.php",
   data: $(form).serialize(),
   success: function(msg){
     alert( "Data Saved: " + msg );
   }
 });
Brant
Thank you - that gets me going in the right direction...Derek
Derek