Javascript examples for DOM HTML Element:Form Event
File input onclick prevent change if user cancels confirm()
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> function check() {/*from w w w. ja v a 2s .c o m*/ return confirm('Okay or cancel, if you cancel no dialog window will be displayed.'); } </script> </head> <body> <input name="post_file" onclick="return check()" type="file" value=""> </body> </html>