|
-
Dec 31st, 2002, 05:11 PM
#1
Thread Starter
Fanatic Member
Get Focus on text box
Hi Everyone,
Currently, I have a text box that has text in it when it is loaded. for example, one says, "Enter Email Address". I have an onFocus command on the text box that erases the text leaving the text box blank when there is focus on it. However, I also want to have the cursor placed in the box when this happens. I have tried the following code and it erases the text like it should but it does not place the cursor in the text box. How can I get this to work?
Code:
function clear_EmailAddress()
{
if (document.SignIn.txtEmailAddress.value == " Enter Email Address")
document.SignIn.txtEmailAddress.value = "";
document.SignIn.txtEmailAddress.focus();
}
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
|
Click Here to Expand Forum to Full Width
|