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

StackOverflow https://stackoverflow.com/questions/4469228

  •  11-10-2019
  •  | 
  •  

문제

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

도움이 되었습니까?

해결책

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");});  
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top