View Full Version : Displaying a page in a frame

12-24-2006, 08:41 PM
Hi there,

I've written a short piece of script which enables me to show a selected user profile. However, instead of showing this on a new page, I want it to be displayed in the in-line frame (Profile) I've created - see code below.

any help would be gratefully receieved.

<% Option Explicit %>
<!--#include file="../usrmgmt/common.asp"-->

<html xmlns="http://www.w3.org/1999/xhtml">
<!-- #BeginTemplate "pgs.dwt" -->
<meta http-equiv="Content-Language" content="en-gb">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="Title" content="Porchester Golf Society - PGS">
<meta name="Author" content="Rakesh Gupta">
<meta name="Subject" content="Golf Society">
<meta name="description" content="This is the Porchester Golf Society website (PGS). Details of all the members, forthcoming golf days during 2004.PGS was established in 1998">
<meta name="keywords" content="PGS, Porchester Golf Society, Golf, 2004, members, events, matchplay, courses,golf forum">
<meta name="Language" content="English">
<meta name="Expires" content="Now">
<meta name="Abstract" content="Porchester Golf Society">
<meta name="Copyright" content=" Porchester Golf Society 1999">
<meta name="Designer" content="Rakesh Gupta">
<meta name="Publisher" content="Rakesh Gupta">
<meta name="Revisit-After" content="1 Days">
<meta name="Distribution" content="Global">
<meta name="Rating" content="Safe For Kids">
<meta name="Category" content="Recreation &amp; Sport">
<meta name="Robots" content="Follow">
<meta name="Reply-To" content="webmaster@porchestergs.com">
<link rel=stylesheet type="text/css" href="../styles.css">
<!-- #BeginEditable "doctitle" -->
<title>Select name</title>
function show_player() {
var sel = document.player_form.player.selectedIndex
var pl = document.player_form.player[sel].value;
var loc = "../profiles/"+pl+".asp";
target = "_parent"
document.location = loc;
<!-- #EndEditable -->

<body style="margin: 20px 30px; background-attachment: fixed; background-image: url('../images/back_header.gif');" >

<table style="width: 800px" cellspacing="0" cellpadding="0" class="style2" >
<!--webbot bot="Include" U-Include="../myborders/top.asp" TAG="BODY" --></td>

<table style="width: 801px" cellspacing="0" cellpadding="0" class="style3">
<td style="height: 80%; width: 107px" align="left" valign="top">
<!--webbot bot="Include" U-Include="../myborders/left.asp" TAG="BODY" --></td>
<!-- #BeginEditable "main" -->
<table style="width: 100%">
<!-- MSTableType="layout" -->
<td style="width: 145px">
<font color="#2A3B75">Select name</font>
<form name="player_form">
<select name="player" size="10" style="height: 342px">
<option selected value="aaaaa">aaaaa</option>
<option value="bbbbbb">bbbbbb</option>
<option value="ccccccc">cccccc</option>
<input type="button" value=" Show info " onclick="show_player();">

<td valign="top">
<iframe name="Profile" id="I1" style="width: 451px; height: 704px" src ="../profiles/prfile_blank.htm">Your browser does not support inline frames or is currently configured not to display inline frames.
<!-- #EndEditable -->
</td> </tr>

<table style="width: 800px" cellspacing="0" cellpadding="0">
<!--webbot bot="Include" U-Include="../myborders/bottom.asp" TAG="BODY" --></td>


<!-- #EndTemplate -->

<!-- #EndTemplate -->


Arty Effem
12-24-2006, 11:40 PM
instead of showing this on a new page, I want it to be displayed in the in-line frame (Profile)

Try: window.frames['Profile'].location.href = loc;

You'll need a provide an alternative for clients without scripting available/enabled.

12-25-2006, 12:49 AM
That worked a treat - many thanks

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum