How do I write a really basic JavaScript login page?

itsnotyouitsme

New member
I need a really basic login that uses JavaScript to validate that the userid and password are correct.

The userid should be either milton1 or shelly15

The password should be k1mb3r for milton1 or 4ng3l for shelly15

This is for a beginner html class assignment, so the lack of security is not an issue. The way I would like it to work is to use a form with an onsubmit event that calls a function. If the username and password are correct, it submits the information. If they are not correct, then the function should do an alert popup box with 'invalid userid/password' or something.
 
Back
Top