开发者

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

开发者 https://www.devze.com 2023-01-31 15:08 出处:网络
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 :

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 开发者_C百科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");});  
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号