#1
  1. No Profile Picture
    Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2001
    Posts
    27
    Rep Power
    0

    Question redirect using javascript with target


    I have two forms that users will need to complete.

    I am using a frameset, the top frame has two check boxes. Depending on which checkbox is selected I want a different html page to load in the main frame.

    Can anybody help me with using a target with :

    window.location.href = 'FILE';

    thanks
  2. #2
  3. No Profile Picture
    Senior Citizen
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Jan 2001
    Location
    leftcoast
    Posts
    2,019
    Rep Power
    16
    It makes more sense to use radio buttons for this, since you should only have one selected at a time.

    <html>
    <head>
    <title>untitled</title>
    </head>
    <body>
    <form>
    <input type="radio" name="goto" value="http://www.salon.com"
    onclick="parent.frames[1].location.href=this.value">Salon
    <br>
    <input type="radio" name="goto" value="http://www.slate.com"
    onclick="parent.frames[1].location.href=this.value">Slate
    <br>
    <input type="radio" name="goto" value="http://www.suck.com"
    onclick="parent.frames[1].location.href=this.value">Suck
    </form>
    </body>
    </html>

    In your <frameset>, put the upper frame (frames[0]) first and the main frame (frames[1]) second. parent takes you up one level - so you can 'step' back down to a sibling frame.
  4. #3
  5. No Profile Picture
    Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2001
    Posts
    27
    Rep Power
    0

    thanks for your response


    Thank you for your suggestion, a little while after I posted the thread I was able to solve my problem as usual, doing basically what you had suggested.

    Thanks for the post.

IMN logo majestic logo threadwatch logo seochat tools logo