开发者

Large PHP enable web form - around 75 field - how best to send email with all fields?

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 开发者_StackOverflowinstead? http://jquery.malsup.com/form/#getting-started

Derek


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 );
   }
 });


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


Use POST instead of GET?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜