FileUpload.onFocus : FileUpload « Form « JavaScript Tutorial






Syntax

onFocus="command"

The onFocus event handler notifies you when the focus is set on the upload box.

<html>
    <head>
    <title>Using the onFocus event handler</title>
    </head>
    <body>
    <script language="JavaScript">
    <!--
    function showMsg1(){
        document.form1.msg.value += "Focus on the FileUpload box\n";
    }
    function showMsg2(){
        document.form1.msg.value += "Focus removed from FileUpload box\n";
    }
    -->
    </script>
    <form name="form1">
    Click in the FileUpload box to set focus to it.
    <br><br>
    <input type="file" name="uploadbox" onFocus = 'showMsg1()'>
    <br><br>
    Click on the button to remove focus from the FileUpload box.
    <br>
    <input type="button" value="Click here" onClick='showMsg2()'>
    <br><br>
    <textarea name="msg" rows="5" cols="50"></textarea>
    </form>
    </body>
    </html>








10.8.FileUpload
10.8.1.FileUpload
10.8.2.FileUpload.blur()
10.8.3.FileUpload.focus()
10.8.4.FileUpload.form
10.8.5.Second Method of Referencing FileUpload Object Using the forms Elements Array
10.8.6.FileUpload.handleEvent()
10.8.7.FileUpload.name
10.8.8.FileUpload.onBlur
10.8.9.FileUpload.onChange
10.8.10.FileUpload.onFocus
10.8.11.FileUpload.select()
10.8.12.FileUpload.type
10.8.13.FileUpload.value
10.8.14.file Input Element