Password

I looked on the net and forum. I know how to create the simple form of verifying a password.
But i am trying to do is if any can please help is…

  1. there is a keypad with an input text field.
  2. person uses his mouse to put his password by clicking on the different buttons on the keypad
  3. if correct logs in and if not…fails

(what i think i am failing in is the input of the data to the textfield which i have to verify there after if its correct.)

thank you