In addition to what copeg said, you say "the "invalid message" pops up" but show no code that pops anythign up. And I've got to ask what:


if (username.value == 'Name')
if (password.value ==...