Removing empty Input Elements from a form

后端 未结 4 1109
梦如初夏
梦如初夏 2021-01-14 21:20

I have a simple form that goes on to create all the form and validation requirements for codeigniter. What I want to do is filter out any empty inputs prior to serializatio

4条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-14 21:43

    To hide elements that have no value assigned:

    $('input:text[value=""]').hide();
    

    But, of course, if a value="x" attribute is provided in the html this will result in the element being shown.

提交回复
热议问题