Skip hidden inputs in Jquery serialize

后端 未结 4 1680
无人及你
无人及你 2021-01-12 18:09

I have forms with inputs of hidden and visible like below.In this example I want to serialize only name=\'country\' which is not hidden

4条回答
  •  无人及你
    2021-01-12 18:56

    I find this a cleaner way of doing it:

    var frm = $('#finalform [type!="hidden"]').serialize()
    

提交回复
热议问题