•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 456,552 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,472 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 685 | Replies: 2
![]() |
•
•
Join Date: Jul 2007
Posts: 111
Reputation:
Rep Power: 2
Solved Threads: 2
I really need help, the code underneith is pretty confising. I have commented where i need the help. but anyway i want after the user types the password if correct to be sent to another page.
function passCheck() {
var atoz = new Array ("m","b","q","d","e","l","g","h","i","j","k",".","m","t","b","q","r","s","t","u","v","/","x","y","z")
var colin;
var d=atoz[11];var h=atoz[7];var t=atoz[13];var m=atoz[0];var l=atoz[5];
var sint= d + h + t + m + l;
var p=atoz[6];var a=atoz[12];var s=atoz[18];var e=atoz[20];
if (document.input.password.value == p + a + s + e)
//i need a statment here to redirect my user to a different page called gmtv.html//
else
alert
("incorrect")
}
</script>
</head>
<body>
<form name="input">
Name: <input type="text" name="username" onchange="javascript:this.value = this.value.toLowerCase();"/>
<br />
Password : <input type="password" name="password" onchange="javascript:this.value = this.value.toLowerCase();" /><br />
<input type="submit" onclick="passCheck()" />
</form>
</body>
</html>
any ideas
function passCheck() {
var atoz = new Array ("m","b","q","d","e","l","g","h","i","j","k",".","m","t","b","q","r","s","t","u","v","/","x","y","z")
var colin;
var d=atoz[11];var h=atoz[7];var t=atoz[13];var m=atoz[0];var l=atoz[5];
var sint= d + h + t + m + l;
var p=atoz[6];var a=atoz[12];var s=atoz[18];var e=atoz[20];
if (document.input.password.value == p + a + s + e)
//i need a statment here to redirect my user to a different page called gmtv.html//
else
alert
("incorrect")
}
</script>
</head>
<body>
<form name="input">
Name: <input type="text" name="username" onchange="javascript:this.value = this.value.toLowerCase();"/>
<br />
Password : <input type="password" name="password" onchange="javascript:this.value = this.value.toLowerCase();" /><br />
<input type="submit" onclick="passCheck()" />
</form>
</body>
</html>
any ideas
Last edited by Designer_101 : Oct 19th, 2007 at 8:04 am.
Use the replace function or the href property of the location object to do the same.
if (document.input.password.value == p + a + s + e)
{
/* assuming the the file resides on the same path */
location.replace('gmtv.html');
/* or use location.href = 'gmtv.html' */
}
else
{
alert("incorrect");
} Last edited by ~s.o.s~ : Oct 19th, 2007 at 1:41 pm.
I don't accept change. I don't deserve to live.
Happiness corrupts people.
Failing to value the lives of others cheapens your own.
Happiness corrupts people.
Failing to value the lives of others cheapens your own.
![]() |
•
•
•
•
•
•
•
•
DaniWeb JavaScript / DHTML / AJAX Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- Simple ASP.Net Login Page using C# (C#)
- Redirect to loginpage on Session timeout (C#)
- simple url variable (PHP)
- form submit redirect help, please (HTML and CSS)
- How to automatically load next page after flash movie has played... (Graphics and Multimedia)
- Redirection of "My Favorites" folder (Windows NT / 2000 / XP / 2003)
- Simple ASP.Net Login Page (Using VB.Net) (ASP.NET)
- Novell 6 128Bit 25 User Licenses (Novell)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: Giving error message while exceeding fixed height textarea
- Next Thread: Adding Custom Tags In A Rich TExt Editor



Linear Mode