Ok, I know this has been solved multiple times, but if you read everything first, you’ll see y mine is different. I want to make the default text in a textbox disappear when onFocus. I have achieved this within the onFocus attribute in the input tag, but I want to use this code across multiple documents. So I set out to make a .js file. Unfortunately, that’s where everything went wrong. For some reason, I can’t get the disappearing text to work now.
import code:
[CODE]<script language=”JavaScript” src=”main.js”></script>
main.js code:
[CODE]<!– BEGIN JAVASCRIPT FILE
function disappear(formName,inputName)
{
if(document.formName.inputName.value == “Enter a search term…”)
document.formName.inputName.value = “”;
}
…
END JAVASCRIPT FILE –>
input line:
[CODE]<input type=”text” name=”search” value=”Enter a search term…” style=”color: #777777;” onFocus=”disappear(‘searchForm’,’search’);” onBlur=”reappear(‘searchForm’,’search’);”>
Thanks much for any help. The page it should be working on is jeff.jcubedtech.com if u need to see that.