HTML5 validation and ASP.net Webforms

前端 未结 2 466
逝去的感伤
逝去的感伤 2021-01-26 23:42

I\'m experimenting with HTML5 built-in validation attributes and the first difficulty I have run into is that the validation attributes work in a form context. I.E. if you want

2条回答
  •  生来不讨喜
    2021-01-27 00:38

    I think you have a misunderstanding.

    HTML 5 has both form and input validation attributes. The form attributes simply allow you to turn on/off autocomplete and completely turn off validation of all of the input elements.

    The input elements are where the real work is performed. Note that you can have autocomplete turned on at the form level, but have it turned off for particular inputs.

    BTW, having nested

    tags is still a no no under HTML5. It's just that various browsers support it in order to continue to be compatible with the vast majority of sites that were coded incorrectly. Actually, this concept, of being as compatible as possible, is the leading reason browsers are so complicated.

    More info: http://www.w3schools.com/html5/html5_form_attributes.asp

提交回复
热议问题