Merge pull request #406 from snakecase/patch-2
Fix check for an empty input or ESC key press
This commit is contained in:
commit
63e1268574
1 changed files with 2 additions and 2 deletions
|
@ -9,13 +9,13 @@ if (userName == 'Admin') {
|
||||||
|
|
||||||
if (pass == 'TheMaster') {
|
if (pass == 'TheMaster') {
|
||||||
alert( 'Welcome!' );
|
alert( 'Welcome!' );
|
||||||
} else if (pass == null) {
|
} else if (pass == '' || pass == null) {
|
||||||
alert( 'Canceled.' );
|
alert( 'Canceled.' );
|
||||||
} else {
|
} else {
|
||||||
alert( 'Wrong password' );
|
alert( 'Wrong password' );
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (userName == null) {
|
} else if (userName == '' || userName == null) {
|
||||||
alert( 'Canceled' );
|
alert( 'Canceled' );
|
||||||
} else {
|
} else {
|
||||||
alert( "I don't know you" );
|
alert( "I don't know you" );
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue