hi,
What you need is the onblur event (leaving the field). And I
have also made the javascript functions generic so they can be used
with any field.
I'm not sure what you mean with the default value here.
"... not entered a username and password to have the box use
the default value..."
But I expect you are not talking about the username and
password of the customer (you should not include that un-encoded in
the raw HTML of the page)
Cheers,
fober
===============================================
<script type="text/javascript">
function focusfield(object, field) {
if (object.value == field)
object.value='';
}
function clearfield(object, field) {
if (object.value == '')
object.value=field;
}
</script>
Username: <INPUT TYPE="text"
NAME="LoginID"
REQUIRED="Yes"
MAXLENGTH="10"
class="loginTextBoxBold"
value="username"
size="12px"
onClick= "focusfield(this, 'username')"
onFocus= "focusfield(this, 'username')"
onBlur= "clearfield(this, 'username')"
><br>
Password: <INPUT TYPE="text"
NAME="LoginPassword"
MESSAGE="Password is required!"
REQUIRED="Yes"
MAXLENGTH="10"
class="loginTextBoxBold"
value="password"
size="12px"
onClick= "focusfield(this, 'password')"
onFocus= "focusfield(this, 'password')"
onBlur= "clearfield(this, 'password')"
>