FileUpload.onFocus : FileUpload : Form JAVASCRIPT TUTORIALS


JAVASCRIPT TUTORIALS » Form » FileUpload »

 

FileUpload.onFocus









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 boxn";
    }
    function showMsg2(){
        document.form1.msg.value += "Focus removed from FileUpload boxn";
    }
    -->
    </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>







HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo Form
» FileUpload