Can't set hidden input field's value using jQuery

前端 未结 11 1764
耶瑟儿~
耶瑟儿~ 2020-12-29 02:45

I have a simple input field inside a form tag:


  
11条回答
  •  青春惊慌失措
    2020-12-29 03:09

    I had the same problem with a hidden input field. Id i set the initial value on 0, it works fine, but sometimes i didn't want to have an initial value of 0. So i tested with value=" ", a whitespace, and it works for me too. If you fill the value dynamic from PHP you could do value="" if 0 is fine for you, or value=" " if a whitespace is fine.

提交回复
热议问题