Ver Mensaje Individual
  #3 (permalink)  
Antiguo 23/07/2013, 09:29
wolfoxley
 
Fecha de Ingreso: julio-2013
Mensajes: 9
Antigüedad: 10 años, 9 meses
Puntos: 0
Respuesta: Estilo en input file

logre hacerlo de estas forma espero que te ayude

hace rato escrivi full comentarios pero esta pagina esta mas horrible que la c g todo

vas a tener que chekarlos full


Código Javascript:
Ver original
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4.     <title></title>
  5.     <script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
  6.     <meta charset='UTF-8'/>
  7. </head>
  8. <body>
  9.  
  10.  
  11. <input id="textisselectedanyfile" type="text" value="Not selected any file">
  12.  
  13. <input type="file" name="photo" id="photo" style="display:none" onchange="updateMessage()"/>
  14.  
  15. <div id="loadtextbotton">my btn</div>
  16.  
  17.  
  18. <style>
  19. #loadtextbotton {
  20.     background-color: black;
  21.     color: white;
  22.     padding: 30px;
  23. }
  24. </style>
  25. <script type="text/javascript">
  26.  
  27.  jQuery(document).ready(function() {
  28.      jQuery("#loadtextbotton").click(function() {
  29.          jQuery("#photo").trigger('click');
  30.      });
  31.  });
  32.  
  33.  function updateMessage() {
  34.      jQuery("#textisselectedanyfile").val(jQuery("#photo").val());
  35.      if (jQuery("#photo").val() == "") {
  36.          jQuery("#textisselectedanyfile").val("Not selected any file");
  37.      }
  38.  }
  39.  
  40. </script>
  41. </body>
  42. </html>