Try declaring with jquery because jquery is not enabled:
<html> <head> <script type="text/javascript" src="http://code.jquery.com/jquery-2.0.0.js"></script> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <script type="text/javascript"> $(document).ready( function(){ $('input:submit').attr('disabled',true); $('input:file').change( function(){ if ($(this).val()){ $('input:submit').removeAttr('disabled'); } else { $('input:submit').attr('disabled',true); } }); }); </script> </head> <body> <form action="#" method="post"> <input type="file" name="fileInput" id="fileInput" /> <input type="submit" value="submit" disabled /> </form> </body> </html>
source share