This article lists some tips and codes about form input boxes in web design. 1. Dashed box when cancel button is pressed <br /> Add attribute value hideFocus or HideFocus=true in input 2. Read-only text box content Add the attribute value readonly to the input 3. Prevent the TEXT document from being cleared after going back (the style content can be used as a class reference) <INPUTstyle=behavior:url(#default#savehistory);type=textid=oPersistInput> 4. The ENTER key moves the cursor to the next input box <inputonkeydown="if(event.keyCode==13)event.keyCode=9"> 5. Only Chinese (flashing) <inputonkeyup="value=value.replace(/[-~]/g,'')"onkeydown="if(event.keyCode==13)event.keyCode=9"> 6. Only numbers (flashing) <inputonkeyup="value=value.replace(/[^/d]/g,'')"onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^/d]/g,''))"> 7. Only numbers (no flashing) <inputstyle="ime-mode: disabled"onkeydown="if(event.keyCode==13)event.keyCode=9"onKeyPress="if((event.keyCode<48||event.keyCode>57))event.returnValue=false"> 8. Only English and numbers can be entered (with flashing) <inputonkeyup="value=value.replace(/[/W]/g,'')"onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^/d]/g,''))"> 9. Block input method <inputtype="text"name="url"style="ime-mode:disabled"onkeydown="if(event.keyCode==13)event.keyCode=9"> 10. Only numbers, decimal points, and minus signs (-) can be entered (no flashing) <inputonKeyPress="if(event.keyCode!=46&&event.keyCode!=45&&(event.keyCode<48||event.keyCode>57))event.returnValue=false"> 11. Only two decimal places or three decimal places can be entered (flashing) <inputmaxlength=9onkeyup="if(value.match(/^/d{3}$/))value=value.replace(value,parseInt(value/10));value=value.replace(//./d*/./g,'.')"onKeyPress="if((event.keyCode<48||event.keyCode>57)&&event.keyCode!=46&&event.keyCode!=45||value.match(/^/d{3}$/)||//./d{3}$/.test(value)){event.returnValue=false}"id=text_kfxename=text_kfxe> |
<<: CSS to achieve scrolling image bar example code
>>: MySQL method of generating random numbers, strings, dates, verification codes and UUIDs
Virtualization and containerization are two inevi...
flex layout Definition: The element of Flex layou...
Table of contents Preface 1. Create objects befor...
Table of contents About MariaDB database in Linux...
This article mainly introduces the solution to th...
Win2008 R2 zip format mysql installation and conf...
Overview This article is a script for automatical...
background In order to support Docker containeriz...
<!--[if lte IE 6]> <![endif]--> Visibl...
Table of contents 1 Difference 1.1 Space Occupanc...
1. Previous versions yum remove docker docker-cli...
1. overflow:hidden overflow hidden If overflow:hi...
Overflow Hide It means hiding text or image infor...
Table of contents Document Object Model (DOM) DOM...
Table of contents 1. Database Overview 1.1 Develo...