①, when you are doing web development, you may also encounter problems that I have encountered before, when using a TextBox control, the edge of the control cannot be completely overwritten by the background picture, as shown in Figure 1:
Because the TextBox parsing is also the Html-text control, and the text control is the default side, that is, the border:1px solid #000;
So as long as the TextBox control plus the following a small sentence of CSS can be, that is, "border:0px", the final effect as shown in Figure 2:
②, everyone in doing web development, do not know if we have found, when the TextBox control TextMode = "MultiLine", in fact, MaxLength has been invalidated.
Because the TextBox's property is TextMode to "MultiLine", after parsing is the Html-textarea control, the HTML control has no maxlength attribute.
If you want to limit its input length at this point: you can set the following properties:
<asp:textbox ID = "reply_note" runat = "server" TextMode = "MultiLine" onkeyup= "this.value " = This.value.slice (0, 10 ) ">
③, when you do some input boxes, you may want to do when the focus of the trigger an event, when the failure to trigger an event:
I wrote two JS just to meet the following effects:
Copy Code code as follows:
<script type= "Text/javascript" >
Trigger event when focus is received
function Onfocusfun (element, Elementvalue) {
if (Element.value = = Elementvalue) {
Element.value = "";
Element.style.color = "";
}
}
Trigger event when leaving input box
function Onblurfun (element, Elementvalue) {
if (Element.value = = "") {
Element.style.color = "#808080";
Element.value = Elementvalue;
}
}
</script>
Then, you can refer to them in the TextBox control as follows:
Copy Code code as follows:
<asp:textbox ID = "reply_note" runat = "text=" Post reply, input Word limit of 1000 words "ForeColor =" #808080 "onfocus=" Onfocusfun (thi S, ' post reply, input Word limit of 1000 words ')
Onblur= "Onblurfun (this, ' post reply, input Word limit of 1000 words ')" ></asp:TextBox>
This is my recent development of a little bit of skill, may have been written on the internet similar, but these methods, I personally think is relatively simple and understandable, hope to help everyone.
If you have other similar tips, you can leave a message to share.