Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Javascript General Javascript discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old March 9th, 2004, 11:43 AM
Authorized User
 
Join Date: Jun 2003
Location: , , .
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
Default Directing users

Hello to all,

I have a question in regards to directing user to a specific page after filling out information...
I have a form that validates fields and a radio button if chosen would determine which page the user would be directed..

I only have one problem and that is when i want to send them to the specific page, iam opening a new browser and I would like the user to be directed using the same window...

here is my code...


    if(form.notxt.checked){
        open('/page1.php');
        }else{
        open('/page2.php');
    }

what is the command to not open a new window but direct them in the same window to the either page...

thanks
--dungey
Reply With Quote
  #2 (permalink)  
Old March 9th, 2004, 12:46 PM
joefawcett's Avatar
Wrox Author
Points: 9,763, Level: 42
Points: 9,763, Level: 42 Points: 9,763, Level: 42 Points: 9,763, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

Not 100% sure I understand but try this:
Code:
 window.location.href  = (form.notxt.checked ? '/page1.php' : '/page2.php');
replace window with top if you are using frames and want to replace the whole frameset.
--

Joe
Reply With Quote
  #3 (permalink)  
Old March 9th, 2004, 04:18 PM
Friend of Wrox
 
Join Date: Nov 2003
Location: , , .
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
Default

Joe,

Shouldn't it be

Code:
 window.location.href  = (form.notxt.checked)? '/page1.php' : '/page2.php';
?

Or does it work like this too?

----------
---Snib---
----------
Reply With Quote
  #4 (permalink)  
Old March 10th, 2004, 05:43 AM
joefawcett's Avatar
Wrox Author
Points: 9,763, Level: 42
Points: 9,763, Level: 42 Points: 9,763, Level: 42 Points: 9,763, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

I think thy're the same. You could remove all the parentheses, I just put them in for reader clarity.:)

--

Joe
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How many users.... rupen Classic ASP Basics 0 October 20th, 2006 08:45 AM
page directing sentme_mail HTML Code Clinic 7 November 22nd, 2004 03:21 PM
Help with redirecting users Sach Classic ASP Databases 1 January 16th, 2004 12:29 PM
Netbean users ....please help me out pratheeba Servlets 1 November 26th, 2003 01:27 PM



All times are GMT -4. The time now is 08:34 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.