jQuery serialize() leaves out textarea

前端 未结 9 1953
醉梦人生
醉梦人生 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条回答
  •  Happy的楠姐
    2020-12-16 11:51

    I have the same experience. Submitting a form using $("#form_id").serialize() does not include the textarea fields. This behavior is consisent for the past 2 years in the only form that has textarea elements. Every now and then I re-examine form and code to conclude that it should work, but doesn't.

    My work-around is, unsurprisingly, to first move the content of the textareas into hidden text boxes and then serialize the form data.

提交回复
热议问题