Play personality give form INPUT element privileges

Source: Internet
Author: User

  1. The Dotted box when the Cancel button is pressed

Add attribute value in input hidefocus or hidefocus=true

  2, read-only text box content

Add attribute value in input readonly

  3, to prevent back to empty the text document (you can do the style content as a class reference)

<input Style=behavior:url (#default #savehistory); Type=text id=opersistinput>

  4, enter key can let the cursor move to the next input box

<input >

  5, only for Chinese (with flashing)

<input onkeyup= "Value=value.replace (/[-~]/g,") ">

  6, only for the number (with flashing)

<input onkeyup= "Value=value.replace (/[^\d]/g,") "Onbeforepaste=" Clipboarddata.setdata (' text ', Clipboarddata.getdata (' text '). Replace (/[^\d]/g, ') ">

  7, only for the number (no flashing)

<input style= "ime-mode:disabled" onkeypress= "if" (event.keycode<48 | | event.keycode>57)) event.returnValue= False ">

  8, can only input English and digital (with flashing)

<input onkeyup= "Value=value.replace (/[\w]/g,") "Onbeforepaste=" Clipboarddata.setdata (' text ', Clipboarddata.getdata (' text '). Replace (/[^\d]/g, ') ">

  9, Shielding Input Method

<input type= "text" name= "url" style= "ime-mode:disabled" >

  10, can only enter the number, decimal point, minus (-) characters (no flashing)

<input onkeypress= "If" (event.keycode!=46 && event.keycode!=45 && (event.keycode<48 | | event.keycode>57)) Event.returnvalue=false ">

  11, only two decimal digits, three decimal places (with flashing)

<input maxlength=9 onkeyup= "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_kfxe name=text_kfxe>



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.