Validating a radio button is checked with jQuery

前端 未结 7 1590
你的背包
你的背包 2021-01-13 07:17

On my form I havea set of radio buttons. Here\'s the mark up:

Format

7条回答
  •  失恋的感觉
    2021-01-13 07:44

    Try the jQuery Validation plugin. It can do a lot for you and be really useful for lots of different forms. If you want to do it very simply:

    if($("input[name=fileType]:checked").length > 0) {
       //Is Valid
    }
    

提交回复
热议问题