-
Control textbox text on events
Good day, Functions neeeded.
I have a search textbox where I would like to display the "Search Keywords" in text of textbox when blank but when mousemove clear text.
1. When textbox is blank then I would like to display text value "Search Key"
2. Onmouseover & Focus: when text value "Search Key" then blank else valu
3. OnMouseLeave / loosefocus: when text value blank then "Search Key" else value
4. I would also like to change the font.
Please Assist
-
-
Hi, I found the below worked for me - not good coding.
<script type="text/javascript" language="javascript">
var EMPTY = "";
function In()
{
var handle = document.getElementById("<%=TextBox1.ClientID%>").value;
var initialText = "Process";
if (handle == initialText)
{
document.getElementById("<%=TextBox1.ClientID%>").value = EMPTY;
document.getElementById('<%=TextBox1.ClientID%>').style.fontStyle = "normal";
}
}
function Out()
{
var handle = document.getElementById("<%=TextBox1.ClientID%>").value;
var initialText = "Process";
if (handle == EMPTY)
{
document.getElementById("<%=TextBox1.ClientID%>").value = initialText;
document.getElementById('<%=TextBox1.ClientID%>').style.fontStyle = "italic";
}
}
</script>
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Bookmarks