How to post a form with many fields with jQuery?

后端 未结 7 2367
不知归路
不知归路 2020-12-15 06:46

Though $.ajax() can be used to do ajax things, I don\'t think its fit for posting values of a big form.

How would you post a big form (many fields) with

相关标签:
7条回答
  • 2020-12-15 07:40

    I've sent rather complex (large) forms with $.ajax() and had no issue. I have not sent files over ajax requests, but I've seen it done and it works better then traditional posts because it doesn't tie up the browser while you are uploading.

    Based on your comment to @zombat, My guess it that you have a very large number of inputs, most of which are going to be blank most of the time. Two suggestions here 1) split the inputs into separate forms and only send each as soon as it is touched/completed. 2) examine the state of your form with JavaScript and wrap the information into JSON or XML, and Instead of posting the form data, post just the data structure.

    "Large" should not be a problem, perhaps you can find a better adjective to describe your data that will let everyone know why it is hard to send.

    0 讨论(0)
提交回复
热议问题