jquery - How to transform textfield data to uppercase while user is typing within the field? -


there textfield : <input type="text" id="id" name="name" value="value" />

how make entered data in uppercase while typing ?

use keyup() , touppercase()..

$('#id').keyup(function(){     $(this).val($(this).val().touppercase()); }); 

or using domelement

$('#id').keyup(function(){  this.value=this.value.touppercase(); }); 

or using css (no javascript @ all)

 #id{     text-transform:uppercase;  } 

using css fiddle

fiddle here


Comments