Bertie
Bertie

Reputation: 17697

JSF 2 / primefaces/ jquery : autoselect, autotab and highlight feature for input elements?

Just want to ask around before implementing own's solution using javascript and css. I wonder if in core jsf tags / primefaces / jquery have the following features :

  1. auto-select : When receiving focus, an input text would auto-select all of the texts, so that it could be replaced instantly by user input without having the user to delete the whole unselected/unblocked string.
  2. autotab : Would like to tab to the next input based on the tabindex defined when the value inputted has reached the limit of defined maxlength in the input text.
  3. highlight : Would like to have a different border or background when an element is focused

Thank you !

Regards, Albert Kam

Upvotes: 0

Views: 2614

Answers (1)

Vivek
Vivek

Reputation: 11028

for your first point this might works for you...

$("input[type=text]").focus(function(){
// Select field contents
this.select();

});

For second point this discussion might help you....
Auto Tab

For third point...

 $("input[type=text]").focus(function(){
    $(this).css("color","red");});  

Upvotes: 1

Related Questions