Merge values from two forms on submit

前端 未结 9 907
甜味超标
甜味超标 2020-11-29 18:12

I have two forms on one html page. Using jQuery, is it possible to have the data from both forms go into the POST data when the first is submitted?

9条回答
  •  春和景丽
    2020-11-29 18:31

    While the other answers address the question you asked, it may be worth considering why you have 2 separate forms, if you want to send the contents of both forms whenever the user submits one.

    If you are using 2 different forms to separate them visually, a better approach may be to use CSS to place the elements on the screen as you desire. That way, you are not relying on the presence of Javascript to ensure that your forms are populated correctly.

提交回复
热议问题