]> SAFE projects GIT repository - jmp/mailleur/commitdiff
Able to hide/show password entry
authorJean-Marc Pigeon <jmp@safe.c>
Tue, 2 Sep 2025 14:56:53 +0000 (10:56 -0400)
committerJean-Marc Pigeon <jmp@safe.c>
Tue, 2 Sep 2025 14:56:53 +0000 (10:56 -0400)
www/scrfun.php

index 047890ddc3ef09aedaf37f119b4d2b9bd4bde752..fe16671592f202a022c306104393e0ff81e9577b 100644 (file)
@@ -50,7 +50,21 @@ function login()
 {
 $STR  = <<<EOT
 
-<!DOCTYPE html>
+<script>
+function myFunction() {
+
+var x;
+  
+x=document.getElementById("myInput");
+if (x.type==="password") {
+  x.type="text";
+  }
+else {
+  x.type = "password";
+  }
+}
+</script>
+
 <table border="0" align="center" width="350" cellpadding="0" cellspacing="0">
     <tr>
       <td><img src="/reg-icons/login.gif" alt="" border="0" /></td>
@@ -73,7 +87,8 @@ $STR  = <<<EOT
                 <tr>
                   <td align="left" nowrap="nowrap">Passord:</td>
                   <td>
-                 <input type="password" name="passwd" size="20" onchange="" />
+                 <input type="password" name="passwd" size="20" id="myInput" />
+                 <input type="checkbox" onclick="myFunction()">Show
                  </td>
                 </tr>
               </table>