Using jQuery to store the state of a complicated form

后端 未结 4 1780
天命终不由人
天命终不由人 2020-12-29 05:52

I have a rather complicated form with many \"steps\" in it that are filled in by the user. Some steps (think of them as form segments) have default options, but on clicking

4条回答
  •  悲哀的现实
    2020-12-29 06:33

    I guess you are looking for .serialize(), which serializes form data. To do that, your input elements need to be within a form tag plus, all of them have to have name attributes.

    var form1data = $('#form1').serialize();
    
    alert(form1data);
    

提交回复
热议问题