1
0
-1

In a Maestro text field I want to trigger the blur and change rules when you press the enter key, in the same way Skype or chat pods work. Anybody have thoughts on how to achieve this?

    CommentAdd your comment...

    1 answer

    1.  
      2
      1
      0

      Hi Ben,

      What do you think about something like below:

      $(":text").bind('keyup',function(e) { 
      	if (e.keyCode === 13){ 
      		e.target.blur();
      		e.target.focus();
      	}
      });

      If you attach above script to form load rule, "blur" will be triggered for each text field when enter is pressed, "change" will be triggered only when a value of the field was changed.

      Regards

      Łukasz

      1. Ben Warner

        This worked, thanks very much Lukasz!

      CommentAdd your comment...