Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>One way to confirm that something has been typed is to use the HTML5 required attribute in the password field like this</p> <pre><code>&lt;input type="password" name="yourname" id="yourid" required /&gt; </code></pre> <p>This always confirms that something has been typed in the password field. May be this helps.</p> <p>Try out this:</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;title&gt;Form validation test&lt;/title&gt; &lt;script type="text/javascript"&gt; function validateAndEncrypt() { var email = document.getElementById("email"); var name = document.getElementById("name"); var pass = document.getElementById("password"); //if you want to validate the password only check the value of password field only if(email.value== "" || name.value == "" || pass.value== "") { alert("One of the fields is empty the script cannot continue.") return false; } else { // you can encrypt your password here alert("Everyting is fine, now we can proceed further"); return true; } } //if you want to check the password field before hitting the button function checkPassword() { var pass = document.getElementById("password"); if(pass.value=="") { alert("The password field is empty"); return false; } return true; } &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;form action="register.php" method="post"&gt; Email: &lt;input type="text" name="email" id="email" /&gt;&lt;br /&gt; Username: &lt;input type="text" name="username" id="name"/&gt;&lt;br /&gt; Password: &lt;input type="password" name="password" id="password" onblur="return checkPassword();"required /&gt;&lt;br /&gt; &lt;input type="submit" value="Register" onclick="return validateAndEncrypt();" /&gt; &lt;/form&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload