① During web development, you may also encounter problems that I encountered before. When using the Textbox Control, the edge of the control cannot be completely overwritten by the background image. 1:
After textbox resolution, it is also an HTML-text control, while the text control has edges by default, that is, border: 1px solid #000;
Therefore, you only need to add the following small CSS for the Textbox Control, that is, "border: 0px", and the final effect is 2:
② When you are doing web development, I wonder if you have found that when textmode = "multiline" of the Textbox Control is replaced, maxlength has actually expired.
When the textmode attribute of textbox is "multiline", it is actually the HTML-textarea control after parsing. This html control does not have the maxlength attribute.
If you want to limit the input length, you can set the following attributes:
<Asp: textbox id = "reply_note" runat = "server" textmode = "multiline"Onkeyup = "This. value = This. value. Slice (0, 1000 )">
③ When you make some input boxes, you may want to trigger an event when you get the focus, or trigger an event when you lose focus:
I wrote two JS files to meet the following requirements:
< Script Type = " Text/JavaScript " >
// Event triggered when the focus is obtained
Function Onfocusfun (element, elementvalue ){
If (Element. Value = Elementvalue ){
Element. Value = "" ;
Element. style. Color = "" ;
}
}
// Triggered when the input box is left
Function Onblurfun (element, elementvalue ){
If (Element. Value = '' ){
Element. style. Color = " #808080 " ;
Element. Value = Elementvalue;
}
}
< / SCRIPT>
Then, you can reference them in the Textbox Control as follows:
< ASP: textbox ID = " Reply_note " Runat = " Server " Text = " Post reply, up to 1000 words entered " Forecolor = " #808080 " Onfocus = " Onfocusfun (this, 'Post reply, up to 1000 words ') "
Onblur="Onblurfun (this, 'Post reply, up to 1000 words ')"> </ASP: textbox>