jQuery serialize() leaves out textarea

前端 未结 9 1946
醉梦人生
醉梦人生 2020-12-16 11:33

When I submit a form using jQuery\'s serialize() method, everything gets submitted except the textarea in the form. Is this a common issue? I can\'t figure it out. The form

9条回答
  •  离开以前
    2020-12-16 11:54

    No it doesn't.

    It works fine. http://jsfiddle.net/nuBkM/


    The JavaScript

    console.log($("form").serialize());
    // => foo=bar&something=lorem+ipsum 
    

    .serializeArray works too

    console.log($("form").serializeArray());
    // => [{name: "foo", value: "bar"}, {name: "something", value: "lorem ipsum"}] 
    

提交回复
热议问题