Input box style Summary

Source: Internet
Author: User

1. text box with only underlines:
<Input style = "border: 0px; border-bottom: 1px solid black;">

2. input box of the software serial number type:
<Script for = "T" event = "onkeyup"> If (value. length = maxlength) document. all [event. srcelement. sourceindex + 1]. focus (); </SCRIPT>
<Script for = "T" event = "onfocus"> select (); </SCRIPT>
<Script for = "Submit" event = "onclick">
VaR Sn = new array ();
For (I = 0; I <t. length; I ++)
Sn = T. value;
Alert (SN. Join ("-"));
</SCRIPT>
<Input name = "T" size = "5" maxlength = "3">-<input name = "T" size = "5" maxlength = "3">-<Input name = "T" size = "5" maxlength = "3">-<input name = "T" size = "5" maxlength = "3">-<input name = "T" size = "5" maxlength = "3">-<input name = "T" size = "5" maxlength = "3">
<Input type = "Submit" name = "Submit">

3. Transparent background in the input box:
<Input style = "Background: transparent; Border: 1px solid # ffffff">

4. Move the mouse over the input box, and the background color of the input box changes accordingly:
<Input value = "type here" name = "user_pass" type = "text" size = "29" onmouseover = "this. style. bordercolor = 'black'; this. style. backgroundcolor = 'plum '"
Style = "width: 106; Height: 21"
Onmouseout = "This. style. bordercolor = 'black'; this. style. backgroundcolor = '# ffff'" style = "border-width: 1px; border-color = black">

5. When entering a word, the border of the input box will flash (the border is a small square ):
<Script language = "JavaScript">
Function bordercolor (){
If (Self ['text']. style. bordercolor = 'red '){
Self ['text']. style. bordercolor = 'yellow ';
} Else {
Self ['text']. style. bordercolor = 'red ';
}
Otime = setTimeout ('bordercolor () ', 400 );
}
</SCRIPT>
<Input type = "text" id = "otext" style = "border: 5px dotted red; color: Red" onfocus = "bordercolor (this ); "onblur =" cleartimeout (otime); ">

6. When entering a word, the border of the input box will flash (the border is a dotted line ):
<Style>
# Otext {border: 1px dotted # ff0000; Ryo: expression (onfocus = function light () {with (document. all. otext) {style. bordercolor = (style. bordercolor = "# ffee00 "? "# Ff0000": "# ffee00"); timer = setTimeout (light, 500) ;}, onblur = function () {This. style. bordercolor = "# ff0000"; cleartimeout (timer )})};
</Style>
<Input type = "text" id = "otext">

7. input box for automatic horizontal loading:
<Input type = "text" style = "huerreson: expression (this. width = This. scrollwidth)" value = "">

8. Text Box automatically stretched down:
<Textarea name = "content" rows = "6" Cols = "80" onpropertychange = "If (this. scrollheight> 80) This. style. posheight = This. scrollheight + 5 "> enter a few carriage returns to give a try </textarea>

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.