I use a script in javascript to convert everything I type, from input to uppercase.
But I have a specific input where I can not change its content. How can I do this?
Follow the code:
// Converte minusculas em maiusculas
$(document).ready(function() {
$('input').on('input', function() {
// Armazena posição corrente do cursor
var start = this.selectionStart,
end = this.selectionEnd;
this.value = this.value.toUpperCase();
// Restaura posição armazenada anteriormente.
this.setSelectionRange(start, end);
});
});
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<input type='text' name='video'>
<input type='text' name='video'>
<input type='text' name='video'>
<input type='text' name='video'>
<input type='text' name='nao_alterar'>