added checkbox and corrected fall back for the other labels

This commit is contained in:
Rene Zubcevic
2019-03-30 12:10:19 +01:00
committed by Nanne Baars
parent 2b2e267594
commit e57c9d05b6
4 changed files with 22 additions and 3 deletions

View File

@ -26,7 +26,8 @@
<table>
<tr>
<td><label>Password</label></td>
<td><input name="password" value="" type="password" placeholder="Enter a secure password"/></td>
<td><input id="myInput" name="password" value="" type="password" placeholder="Enter a secure password"/></td>
<td><input type="checkbox" onclick="javascript:myFunction()"/>Show password</td>
</tr>
<tr>
<td><button type="SUBMIT">Submit</button></td>
@ -46,4 +47,16 @@
<div class="adoc-content" th:replace="doc:SecurePasswords_4.adoc"></div>
</div>
<script>
function myFunction() {
var x = document.getElementById("myInput");
if (x.type === "password") {
x.type = "text";
} else {
x.type = "password";
}
}
</script>
</html>