If someone has pressed CAPSLOCK while typing the password,
abcXYZ123
will result in
abcXYZ123
(or maybe ABCxyz!"§
on some OS?)
How can I convert this correctly?
with mb_strtolower() I can only convert it all to lowercase.
With:
mb_strtolower('ABCxyz!"§');
the numbers are not restored:
abcxyz!"§
just show message about capslock when user entering it and dont care... You cant detect if user use capslock or not in server side.
fast sample how you can detect when user enter char:
$('#password').keypress(function(e) {
var s = String.fromCharCode( e.which );
if ( s.toUpperCase() === s && s.toLowerCase() !== s && !e.shiftKey ) {
alert('caps is on');
}
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments