hi
I use below code to show watermark in textbox
<script type="text/javascript">
function WaterMark(txt, evt, msg) {
if (txt.value.length == 0 && evt.type == "blur") {
txt.style.color = "#b1b1b1";
txt.value = msg;
}
if (txt.value == msg && evt.type == "focus") {
txt.style.color = "black";
txt.value = "";
}
}
</script>
<asp:TextBox ID="TextBox1" runat="server" CssClass="txtSef" Text="enter your name" onkeydown = "return isNumeric(event.keyCode);" onpaste = "return false;"
ForeColor="#b1b1b1" onblur="WaterMark(this, event,'enter your name');" onfocus="WaterMark(this, event,'enter your name');"></asp:TextBox>
here I define button that when click on button it will bind gridview according text that users type into textbox
now problem is as you see watermark color here is #b1b1b1 when I type text into textbox color change to black untill now every things is ok but when I click button to bind gridview it change textbox text's color to #b1b1b1 I want it be black I want just watermark color be #b1b1b1 but here when click button it change textbox text's color to b1b1b1
best regards
neda