Ver Mensaje Individual
  #3 (permalink)  
Antiguo 12/06/2011, 14:48
Avatar de emprear
emprear
Colaborador
 
Fecha de Ingreso: junio-2007
Ubicación: me mudé
Mensajes: 8.388
Antigüedad: 16 años, 9 meses
Puntos: 1567
Respuesta: texto fantasma en un input

alette666:
A ver si esto te sirve

Código HTML:
Ver original
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  2.    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <title>Cambiar Propiedad</title>
  6. </head>
  7. <form action="#" method="post" id="formlogin">
  8.     <div>
  9. <input type="text" class="texto" name="nombre_ingreso" value="usuario"  onclick="this.value='';" onfocus="this.select()" onblur="this.value=!this.value?'usuario':this.value;" />
  10. <br />
  11. <input type="password" class="texto" name="clave_ingreso" value="contraseña"  onclick="this.value='';" onfocus="this.select()" onblur="this.value=!this.value?'contraseña':this.value;" />
  12. </div>
  13. </form>
  14. </body>
  15. </html>

Demo, con 2 campos
http://foros.emprear.com/jsdemo/limpiar_input.html

Saludos
__________________
La voz de las antenas va, sustituyendo a Dios.
Cuando finalice la mutación, nueva edad media habrá
S.R.

Última edición por emprear; 12/06/2011 a las 14:54 Razón: demo