Ver Mensaje Individual
  #5 (permalink)  
Antiguo 10/07/2012, 15:40
aguiacir
 
Fecha de Ingreso: junio-2012
Ubicación: Mexico DF
Mensajes: 16
Antigüedad: 12 años, 9 meses
Puntos: 1
Respuesta: Sacar la inicial de un input. Primera Letra

Gracias a todos por sus consejos.
Lo resolvi asi

Código HTML:
Ver original
  1. <script>   
  2. function mundo(){
  3.         var one = document.getElementById('nombre').value.substr(0,1);
  4.         document.getElementById('inicial').value = one;
  5.     }
  6.     </script>
  7.  
  8. <input type="text" id="nombre" placeholder="Nombre" />
  9. <input type="text" id="inicial" placeholder="Inicial" style="display:none; width:40px;" />
  10. <input type="checkbox" title="Solo la inicial" onclick="mundo(); $('#inicial').toggle();$('#nombre').toggle()" />(Muestra Inicial)

En realidad no se como funciono muy bn.
Pero agarra, solo cambie los nombres de los id