ok, I'm trying to make a basic password page for a friend that he's going to use for some project he's doing.
There's two textboxes, and the user enters his username & password. WHen you click on the button, it's supposed to send the value of those textboxes to the function. I can't figure out how to do that, though.
Here's my code:
There's two textboxes, and the user enters his username & password. WHen you click on the button, it's supposed to send the value of those textboxes to the function. I can't figure out how to do that, though.
Here's my code:
Code:
<html>
<head>
<SCRIPT LANGUAGE="JavaScript">
function myfunction(user,pass){
alert("in function");
if (user=="test" && pass=="test") {
window.location="www.nformant.net";
alert("works!");
}else { alert("doesn't work")};
}
</SCRIPT>
</head>
<body>
<form name="myform">
<LABEL ACCESSKEY=U>User name: <INPUT TYPE=text NAME=user SIZE=12 MAXLENGTH=8></LABEL><br>
<LABEL ACCESSKEY=P>Password: <INPUT TYPE=password NAME=pass VALUE="test" SIZE=12 MAXLENGTH=12></LABEL><br>
<input type="button" value="enter password" onClick="myfunction(user,pass);">
</form>
</body>
</html>