hi gang.
im trying to execute a prompt in javascript that contains 2 input fields.
1. is login
2. is password
sounds easy enough right?
well i've been researching this all day and all i find is that you can only check one prompt input at a time.
additonally if you want 2 fields to check - it seems that people create their own prompt FORM to do it.
what i want to know is if there is a way for the browser API to let me have 2 fields for input rather than having to create a page for it.
if anyone has any advice on this it'd be greatly appreciated.
Please bear in mind i want the browser to generate the popup verification with TWO fields (like a prompt with 2 fields SIMULTANEOUSLY) not 1 after the other (as is seen here) and i DO NOT want to have to use a second (loaded in) webpage to do it. It really needs to be done by the browser.
my source looks like this right now:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>TBG Portal</title>
<script language="JavaScript">
<!--hide
var password;
var login;
<!-- case sensitive buffers --!>
var log1="demo";
var log2="DEMO";
var log3="Demo";
var pass1="password";
var pass2="PASSWORD";
var pass3="Password";
password=prompt('Password',' ');
login = prompt ('login:', ' ');
if ((password==pass1 || password==pass2 || password==pass3) && (login==log1 || login==log2 || login==log3))
alert('Password and Login Accepted: Click OK to enter'); <!-- this allows page to continue loading--!>
else
{
alert('Password or Login Incorrect: Click OK to try again');
window.location="entry.html"; <!-- this reloads page lockout --!>
}
//-->
</script>
</head>
<body>
VIEWING THIS PAGE. LOCKED OUT TIL PASS LOG CORRECT.
</body>
</html>



Reply With Quote



Bookmarks