html5: Significance of attribute named required in checkbox/radio

前端 未结 4 741
暖寄归人
暖寄归人 2021-01-04 01:05

On form submission, how could you possibly mark a checkbox/radiobutton as required?

Source of inspiration: Pekka\'s answer to a question

4条回答
  •  一向
    一向 (楼主)
    2021-01-04 01:31

    I tested required attribute for Radio Buttons today on Firefox 17.0.1 on XP SP2.

    It seems to comply with the specification of required attribute for radio buttons/groups. As Firefox prompts "Please select one of these options." for both of the code snippets below:

    Either you set required attribute for each of the radio buttons

    
    
    

    Or Any One of the Radio elements

    
    
    
    

    Any comments and updates are welcome.

提交回复
热议问题