It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming HTML Forum

Redirecting to another page using IF function

Redirecting to another page using IF function

Postby gcoudert on Sun Feb 15, 2009 12:44 pm

I am a total newbie to html/JavaScript. This is what I am trying to do:
- User enters 2 passwords in the form - OK so far.
- If one of them is wrong, a box comes up that says "Incorrect credentials!" - this works fine.
- If they are both correct, the viewer is redirected to a page called "wm.htm" (or possibly to its URL) which is in the same directory - this doesn't work.

Problem is, I cannot get that file/URL to appear although it does exist in the right location. I get the 404 page every time. So what is the correct code to use to make the "wm.htm" appear after the IF statement is validated?

I have attached a screenshot of the code I used as I couldn't upload txt, rtf or doc files.

Can anybody please help?

Thanks,

Gilles

code.JPG
You do not have the required permissions to view the files attached to this post.
gcoudert
 
Posts: 3
Joined: Sun Feb 15, 2009 12:11 pm

Re: Redirecting to another page using IF function

Postby palme on Sun Mar 08, 2009 6:51 am

Hi
instead of the red text ,write for example:

open('wm.htm' , 'write a name for new window')

if you want to know more about it , search after "window object in javascript"
palme
 
Posts: 37
Joined: Wed Aug 06, 2008 9:18 pm

Re: Redirecting to another page using IF function

Postby flabbyrabbit on Sun Mar 08, 2009 4:49 pm

You can either use that example or:
Code: Select all
document.location = "wm.html"

To be honest if you are using javascript to protect a page you might as well not protect it at all.

Flabby Rabbit
Image
User avatar
flabbyrabbit
500+ Club
 
Posts: 706
Joined: Thu Jan 25, 2007 1:10 pm
Location: Midlands, England


Who is online

Users browsing this forum: No registered users and 10 guests