0

I have a "Enter your pin" field in a page. I have kept the input type for this field as password. The problem is that when a user clicks on the submit button, the browser asks to save the password(which I don't want). I have tried autocomplete="off" as well but it didn't work either.

The other solution that I have been trying is that I keep the input type as text and convert the text into password bullets as a user enters the text(onkeyup) with jquery. I have a variable in which I want to store the value of the pin. Now if I keep feeding the value of the input to the variable on every keyup event, and then convert the character into password bullet instantaneously, the value of the variable on the next keyup event will also include the password bullets that had been converted in the previous iteration.

The other long way is to get the value of each character entered in the input and append it to the variable. But then this process becomes too long and I will also have to handle key presses such as "backspace", "delete", "tab".

All I really want is to get the pin entered and the browser should not ask to save it

Any help will be really really appreciated.

1 Answers1

1
<input type="textbox" id="UserID" />
<input type="password" style="display:none"/>
<input type="textbox" id="password" />

<script>
  function init() {
       $('#password').replaceWith('<input type="password" id="password" />');
  }     
</script>
Waqas Shahid
  • 1,051
  • 1
  • 7
  • 22