Forum Moderators: phranque
<form method="get" action="Search/search.asp">
<label for="search">Site Search:</label><br />
<input type="text" name="zoom_query" size="15" id="search" value="Site Search" onfocue="clearDefault(this)" /> <input type="submit" value="Search!" />
</form>
You'll notice an "onfocus" command in the text input box. This clears any pre-defined "value" when the cursor is placed in the box. The script for that is:
<script type="text/javascript">
function clearDefault(el) {
if (el.defaultValue==el.value) el.value = ""
}
</script>
Also, here's a script if you want the cursor to start in the box automatically:
onload="document.emailform.name.focus()"
Replace 'emailform' with the name of your form and 'name' with the name of the field. Put the script in the <body> tag:
<body onload="document.emailform.name.focus()">
Hope this helps.
Marshall
[edited by: Marshall at 6:30 pm (utc) on July 17, 2007]
[google.com...]
Google Custom Business Search $100 Per Year < 5000 Pages
[google.com...]
[webmasterworld.com...]