Note that there are some explanatory texts on larger screens.

plurals
  1. POJavascript - Checking the password field with regular expressions
    primarykey
    data
    text
    <p>I am working on a regular expression to check the password field, Now the javascript that tests the varible is working, but when I try to call it and check the form I can't seem to get the javascript to see that I want it to check the password in the form with the javascript I made but I can't seem to get the form to commnuicate with the javascript I made, The form and the javascript are on the same page, what I want for it to do is after it checks the password requirements it will just go and submit the form. Here is what I have so far.</p> <pre><code>&lt;html&gt; &lt;body&gt; &lt;script type="text/javascript"&gt; function checkPassword(password) { password = document.getElementById('thethePasswordFieldField').value; var patt=/[a-z]/g; var patt2 = /[A-Z]/g; var patt3 = /[0-9]/g; var patt4 = /[~\!@#\$%\^&amp;*_\-\+=`\|\\(\)\{\}\[\]:;"'&lt;&gt;,\.\?\/]/g; var result=patt.test(password); var result2=patt2.test(password); var result3=patt3.test(password); var result4=patt4.test(password); if (!result) alert("Needs a lowercase &amp; uppercase letter, a number &amp; a special character."); if (!result2) alert("Needs a lowercase &amp; uppercase letter, a number &amp; a special character."); if (!result3) alert("Needs a lowercase &amp; uppercase letter, a number &amp; a special character."); if (!result4) alert("Needs a lowercase &amp; uppercase letter, a number &amp; a special character."); if (result &amp;&amp; result2 &amp;&amp; result3 &amp;&amp; result4) alert(""); document.getElementById('frmApplication').submit(); } &lt;/script&gt; &lt;form id="frmApplication" name="frmApplication" action="test.html" method="post"&gt; Password: &lt;input type="text" name="thethePasswordFieldField" id="thethePasswordFieldField"&gt; &lt;a href="javascript:checkPassword()"&gt;Submit&lt;/a&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.
 

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