HTML5 form validation pattern alphanumeric with spaces?

后端 未结 7 2141
借酒劲吻你
借酒劲吻你 2020-12-08 00:10

I have the following input tag in my html5 form:

7条回答
  •  余生分开走
    2020-12-08 00:44

    Use below code for HTML5 validation pattern alphanumeric without / with space :-

    for HTML5 validation pattern alphanumeric without space :- onkeypress="return event.charCode >= 48 && event.charCode <= 57 || event.charCode >= 97 && event.charCode <= 122 || event.charCode >= 65 && event.charCode <= 90"

    for HTML5 validation pattern alphanumeric with space :-

    onkeypress="return event.charCode >= 48 && event.charCode <= 57 || event.charCode >= 97 && event.charCode <= 122 || event.charCode >= 65 && event.charCode <= 90 || event.charCode == 32"

提交回复
热议问题