Ask your own question, for FREE!
Computer Science 11 Online
OpenStudy (chosenmatt):

help please check code

OpenStudy (chosenmatt):

<html> <head> <title>Login page</title> </head> <body> <h1>Simple Login Page</h1> <form name="login"> Username<input type="text" name="userid"/> Password<input type="password" name="pswrd"/> <input type="button" onclick="check(this.form)" value="Login"/> <input type="reset" value="Cancel"/> </form> <script language="javascript"> function check(form) { /*function to check userid & password*/ /*the following code checkes whether the entered userid and password are matching*/ if(form.userid.value == "myuserid" && form.pswrd.value == "mypswrd") { window.open('target.html')/*opens the target page while Id & password matches*/ } else { alert("Error Password or Username")/*displays error message*/ } } </script> </body> </html>

OpenStudy (rsmith6559):

Aren't action and method attributes required in form tags? Other than that, it looks good.

OpenStudy (anonymous):

move script to head section and add action , method to form. <form action="demo_form.asp" method="get">

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!