Web design tips on form input boxes

Web design tips on form input boxes
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>

<<:  Detailed explanation of the process of Zabbix active, passive and web monitoring in distributed monitoring system

>>:  Use of MySQL SHOW STATUS statement

Recommend

CentOS7 deployment Flask (Apache, mod_wsgi, Python36, venv)

1. Install Apache # yum install -y httpd httpd-de...

Solutions to VMware workstation virtual machine compatibility issues

How to solve VMware workstation virtual machine c...

Implementation of the login page of Vue actual combat record

Table of contents 1. Preliminary preparation 1.1 ...

Use jQuery to fix the invalid page anchor point problem under iframe

The application scenario is: the iframe page has n...

How to implement vue page jump

1. this.$router.push() 1. Vue <template> &l...

Nginx uses ctx to realize data sharing and context modification functions

Environment: init_worker_by_lua, set_by_lua, rewr...

Example code for implementing anti-shake in Vue

Anti-shake: Prevent repeated clicks from triggeri...

HTML table tag tutorial (33): cell vertical alignment attribute VALIGN

In the vertical direction, you can set the cell a...

MySQL 5.7.17 and workbench installation and configuration graphic tutorial

This article shares the installation and configur...

Win2008 R2 mysql 5.5 zip format mysql installation and configuration

Win2008 R2 zip format mysql installation and conf...

MySQL daily statistics report fills in 0 if there is no data on that day

1. Problem reproduction: Count the total number o...

Explanation and example usage of 4 custom instructions in Vue

Four practical vue custom instructions 1. v-drag ...

How to install lua-nginx-module module in Nginx

ngx_lua_module is an nginx http module that embed...