dauzcode

enable sumbit if have file

Aug 16th, 2012
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
jQuery 0.69 KB | None | 0 0
  1. <!DOCTYPE HTML>
  2. <html lang=en>
  3. <head>
  4.     <title>Belajar Jquery dan Ajax</title>
  5.    
  6.     <style type="text/css">
  7.     </style>       
  8.  
  9. </head>
  10. <body>
  11.     <form action="#" method="post" enctype="multipart/form-data">
  12.         <input type="file" />
  13.         <input type="submit" id="bubmit" value="Upload" />
  14.     </form>        
  15.        
  16.      <script type="text/javascript" src="jquery.js"></script>  
  17.      <script type="text/javascript">
  18.         $(document).ready(function(){
  19.          $('input[type="file"]').change(function(){
  20.           $(this).next().removeAttr('disabled');
  21.          })
  22.          .next().attr('disabled', 'disabled');
  23.            
  24.         });  
  25.  
  26.    
  27.     </script>
  28.  
  29. </body>
  30. <html>
Advertisement
Add Comment
Please, Sign In to add comment