Code written to change type of template to password type and handle
keypress event