-1

I want to get signal of it. Because I am creating face recognition add-on (like master password) for firefox.

edit: when user add username I need to check user face. If only the given username and his saved face are equal, then only password should put in to password field. What I want is when user add his username execute my application to recognize face. I want to get signal of after adding username.

Mangala Edirisinghe
  • 1,111
  • 2
  • 15
  • 32
  • please elaborate your problem.. – vipul_vj Jul 01 '12 at 06:27
  • textContent & onfocus/blur would be my guess https://developer.mozilla.org/en/DOM/HTMLTextAreaElement – Yansky Jul 01 '12 at 13:05
  • [What have you tried?](http://whathaveyoutried.com) Here on Stack Overflow, question in the form of "How to do X?" without any code shown or a particular problem described, is unlikely to get a good and complete answer. Also, you're still being not specific enough, there's a ton of approaches and things to consider. – Petr Janeček Jul 01 '12 at 15:43

1 Answers1

1

The basic naive solution is to add an event listener on all text input elements and listen for any event that suits your needs, particularly interesting in your case should be focus, blur, or maybe input events. There's also the element.onchange property that might get handy.

Typical usage (simplified logic):

var inputs = document.getElementsByTagName("input");
for (var i = 0; i < inputs.length; i++) {
    inputs[i].onchange = yourFunctionToCall;
}

Some additional notes:

  1. It might be a good idea to add listeners only on pages that have a stored password.
  2. It might be a good idea to add listeners only on pages that contain at least one <input type="password" /> element.
Petr Janeček
  • 37,768
  • 12
  • 121
  • 145