Search code examples
htmlformsbrowserpasswordbox

HTML forms - enabling browers to ask for remembering the value of a text form?


I have a field that I've labeled 'password', and I'd like the browser to ask the user whether they want to store that password. How do I do this? Is there an HTML attribute to use?

For instance the HTML for the form would be:

<form action="" method="POST" name="form">
Enter password:
<input type="text" name="password" /><br />
A checkbox
<input type="checkbox" name="some_checkbox" value="Yes" /><br />
A textarea<br />
<textarea name="input_text" cols=40 rows=10></textarea><br />
<input type=submit value="Submit">

And I'd like the browser to prompt for storing the 'password' input.


Solution

  • This should do it:

    <input type="password" name="password" />
    

    Note the proper type for the password box.