PDA

View Full Version : Mini Mods - Caps Lock Warning


alexgeek
12-23-2007, 10:00 PM
What it does.
This mini-mod will detect if the password entered is in all caps and alert the user that caps lock may be on. Not much of a mod I know, but this is my first.



Step 1.
Upload tooltip.js to the your forum root (website.com/, website.com/forums/ etc.).

Step 2.
In navbar at the following at the top.
<script type="text/javascript" src="tooltip.js"></script>

Step 3.
find the following in navbar or header (possibly other template, dependent on style.):
<input name="vb_login_password" id="navbar_password" type="password" tabindex="102" class="forms3" />
Replace it with:

<input type="password" class="bginput" style="font-size: 11px" name="vb_login_password" id="navbar_password" size="10" tabindex="102" onkeydown="caps(this.value);" />


Done!

Test by putting caps lock on and entering a password such as "AAAA" you should get a small tooltip as a warning (may take a second to load).


German Version (https://vborg.vbsupport.ru/showthread.php?p=1408036#post1408152)

alexgeek
12-24-2007, 01:18 AM
Note!
If you want to use this validation in any other text inputs just add the following attribute to the <input> tag of said text input.
onkeydown="caps(this.value);"

e.g. To check when giving a rep comment.
Find in reputation bit:

<input type="text" class="bginput" size="40" maxlength="250" name="reason" id="reason_$postid"/>

Add in the event:

<input type="text" class="bginput" size="40" maxlength="250" name="reason" id="reason_$postid" onkeydown="caps(this.value);" />



________________

Also, do not try to move the script include to the <head>, the object will throw an error.

skrazydogz
12-24-2007, 06:23 AM
I dont find in navbar the code

<td><input type="password" class="bginput" style="font-size: 11px" name="vb_login_password" id="navbar_password" size="10" tabindex="102" /></td>

:mad:

skrazydogz
12-24-2007, 06:28 AM
My step 3 is:!!!

Find in template "header"!

<input name="vb_login_password" id="navbar_password" type="password" tabindex="102" class="forms3" />


Replace with!

<input name="vb_login_password" id="navbar_password" type="password" tabindex="102" class="forms3" onkeydown="caps(this.value);" />


Thats the right way and it goes ;):D


And the German version as attachment!

alexgeek
12-24-2007, 07:07 AM
Great I've updated it.
Thanks for the translation!

skrazydogz
12-24-2007, 07:24 AM
you must type "find the following in header" and not "find the following in navbar" ;)

alexgeek
12-24-2007, 08:35 AM
It's in the navbar for me.

daz1967
12-24-2007, 08:59 AM
it all depends on the style to where the code is, I have several skins on my site and in 70% it's in the navbar and the rest it's in the header

alexgeek
12-24-2007, 10:19 AM
Updated instructions! :)

Konstantinos
12-25-2007, 06:05 PM
does this work for greek posts ?

alexgeek
12-27-2007, 09:51 PM
Greek use different letters don't they?
If so I don't think so.
If you can give me "A-Z" in greek I may be able to get it to work.

Konstantinos
12-31-2007, 08:03 AM
ok here it is

alexgeek
12-31-2007, 11:18 AM
Tell me if it works (doubt that it will).
If not I'll have another go.

You have to rename it to "tooltip.js"

Rs06 Ant
06-24-2008, 01:14 PM
Cant found any of the code in any of my templates im using. Tried a partial search and it comes up with nothing?

Welshy2008
08-09-2008, 10:10 AM
None of this has worked for me. :(

codershark
11-28-2008, 03:46 PM
works fine for 3.8 Beta 4