Note that there are some explanatory texts on larger screens.

plurals
  1. POShow error message in a tool tip
    primarykey
    data
    text
    <p>I've a user registration form and I want to show the password rules in small tool tip along with the validation message like invalid password or valid password.My password rule is it contains 7 letters, 1 digit and 1 upper case letter etc.</p> <p>Currently I've both of these but showing it in two different tool tip how can I merge two and show it in a single one.</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;script src="http://cdn.jquerytools.org/1.2.6/full/jquery.tools.min.js"&gt;&lt;/script&gt; &lt;title&gt;Test&lt;/title&gt; &lt;/head&gt; &lt;script&gt; function validatePassword(obj) { //rule contains 7 chars and upper case and lower case and digit var password = obj.value; var numLowers = 0; var numCaps = 0; var numDigits = 0; var valid = true; if(password.length &gt; 7) { for(i = 0; i &lt; password.length; i++) { var charCode = password.charCodeAt(i); if(charCode &gt;= 48 &amp;&amp; charCode &lt;= 58 ) numDigits++; else if(charCode &gt;= 65 &amp;&amp; charCode &lt;= 90 ) numCaps++; else if(charCode &gt;= 97 &amp;&amp; charCode &lt;= 122 ) numLowers++; } if(numDigits &lt; 1 || numCaps &lt; 1 ) valid = false; } else { valid = false; } if(!valid){ document.getElementById("password-error").style.display="block"; } else { document.getElementById("password-error").style.display="none"; } } &lt;/script&gt; &lt;body&gt; &lt;div&gt; &lt;form id="test" action ="#"&gt; &lt;div id="password-container"&gt; &lt;input type="text" id= "password" name="password" size="30" onKeyUp="validatePassword(this)" title=" Password contains 7 -20characters &lt;br/&gt; and upper case and digits." /&gt; &lt;/div&gt; &lt;div id="password-error" class="error" style="display:none;"&gt;Invalid Password&lt;/div&gt; &lt;/form&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; $("#test :input").tooltip({ // place tooltip on the right edge position: "center right", // a little tweaking of the position offset: [-2, 10], // use the built-in fadeIn/fadeOut effect effect: "fade", // custom opacity setting opacity: 0.7 }); </code></pre> <p>You can see a working example here </p> <p><a href="http://jsfiddle.net/ddrYp/6/" rel="nofollow">http://jsfiddle.net/ddrYp/6/</a></p>
    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. 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