Put words in capital letters

1

I have an input and I would like that when the user types in the letters they are getting in a capital letter because of the javascript effect. Without the form I can, but when I put the form does not work.

'

<ui:define name="content">  
<h:form id="frm">
    <p:outputLabel value="Cliente" for="cliente" />
    <p:inputText id="cliente" value="#{cadastroOrcamentoBean.orcamento.cliente}" />

</h:form>
</ui:define>'

'

$("#cliente").keyup(function(){
var start = this.selectionStart,
    end = this.selectionEnd;

$(this).val( $(this).val().toUpperCase() );
this.setSelectionRange(start, end);});

'

    
asked by anonymous 12.03.2016 / 19:35

1 answer

1

I managed to resolve. The selector is as in the code below.

$("#frm\:cliente").keyup(function(){

var start = this.selectionStart,
    end = this.selectionEnd;

$(this).val( $(this).val().toUpperCase() );
this.setSelectionRange(start, end);});
    
12.03.2016 / 22:29