Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make everything in a textfield be capital letters / uppercase?

Tags:

I want to make everything I write in a textfield to be capital letters. As I write, not after losing focus.

How do I do this using jQuery?

like image 861
randomizertech Avatar asked Oct 04 '10 19:10

randomizertech


2 Answers

I would use CSS for this.

Just add text-transform: uppercase to your styling, and then on the server side you can convert it to uppercase.

input {   text-transform: uppercase; } 
like image 136
Brandon Avatar answered Oct 11 '22 11:10

Brandon


$('input[type=text]').keyup(function() {     $(this).val($(this).val().toUpperCase()); }); 
like image 23
Gazler Avatar answered Oct 11 '22 11:10

Gazler