Comunidad de diseño web y desarrollo en internet online

input!!!

Citar            
MensajeEscrito el 29 Oct 2008 01:46 pm
gente flashera, como puedo hacer para que en un input text, escriba algo y ya lo escriba en mayusculas, osea, alguna propiedad del input que me convierta a mayusculas aunque el usuario haya usado minusculas .

saludos, grax!

Por da_vidricota

20 de clabLevel



 

firefox
Citar            
MensajeEscrito el 29 Oct 2008 02:17 pm
Tenes que agregarle un evento al campo texto para que eso ocurra.

var txtListener:Object = new Object(); // creas el objeto que tendrá el metod de transformacion a may.

txtListener.onChanged = function(textfield_txt:TextField) {
texto_str=texto_txt.text; // pasas el texto al obbjeto string porque es el que tiene el metodo de pasar a may.
texto_txt.text=texto_str.toUpperCase();
};

texto_txt.addListener(txtListener); // le sumas el evento al texto

ya está.
Cada vez que escribas, se transformará en mayuscula lo que escribas

Por DataGestion

15 de clabLevel



Genero:Femenino  

msie7
Citar            
MensajeEscrito el 29 Oct 2008 02:23 pm
nombre_txt.onChanged = function() {
this.text = this.text.toUpperCase();
};

lo estaba resolviendo asi tambien. sin el listener.

gracias igual!

Por da_vidricota

20 de clabLevel



 

firefox

 

Cristalab BabyBlue v4 + V4 © 2011 Cristalab
Powered by ClabEngines v4, HTML5, love and ponies.