Home >Web Front-end >HTML Tutorial >[HTML]输入框被限制输入某些类型数据_html/css_WEB-ITnose

[HTML]输入框被限制输入某些类型数据_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 11:19:321299browse

ENTER键可以让光标移到下一个输入框<input onkeydown="if(event.keyCode==13)event.keyCode=9" > 只能是中文<input onkeyup="value=value.replace(/[ -~]/g,'')" onkeydown="if(event.keyCode==13)event.keyCode=9"> 只能是英文和数字.屏蔽了输入法<input style="ime-mode:disabled" onkeydown="if(event.keyCode==13)event.keyCode=9"> 只能输入英文和数字<input onkeyup="value=value.replace(/[\W]/g,'') "onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))" onkeydown="if(event.keyCode==13)event.keyCode=9"> 只能是数字<input onkeyup="value=value.replace(/[^\d]/g,'') "onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))">只能显示,不能修改的文本框<input readOnly value="只能显示,不能修改">

 

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn