Why won't onBlur work in HTML (Dreamweaver)?

I am assuming it means that since onFocus in a text box is when it becomes active that onBlur is when it becomes non-active. Or in other words, when the user clicks outside the box, goes into another box, or leaves the text box in any way. Unfortunately, I can't get this function to work. I put "onBlur="functionName()" and functionName is document.fa.name.value="";, which is supposed to set the value of the field "name" in the form "fa" to nothing, but it doesn't work. Any suggestions are greatly appreciated. Thanks in advance!
 
Try the following code, and build on it.

<HTML>
<HEAD>
<SCRIPT language=javascript>
function foo(whom) {
***alert (whom);
}
</SCRIPT>
</HEAD>
<BODY>
<INPUT TYPE=text
***NAME=Fred
***onBlur="foo('left Fred');">
</INPUT>
<INPUT TYPE=text
***NAME=Bill
***onBlur="foo('left Bill');">
</INPUT>
</BODY>
</HTML>

I find it's always useful to use the "alert" function to assure me that the javacript is being called the way I think it's supposed to be called.
 
Try the following code, and build on it.

<HTML>
<HEAD>
<SCRIPT language=javascript>
function foo(whom) {
***alert (whom);
}
</SCRIPT>
</HEAD>
<BODY>
<INPUT TYPE=text
***NAME=Fred
***onBlur="foo('left Fred');">
</INPUT>
<INPUT TYPE=text
***NAME=Bill
***onBlur="foo('left Bill');">
</INPUT>
</BODY>
</HTML>

I find it's always useful to use the "alert" function to assure me that the javacript is being called the way I think it's supposed to be called.
 
Back
Top