Jump to content

Setting Target Frame for onclick in an Input Button


Buoka

Recommended Posts

I wish to use buttons (either Input Button or just a Button) that when click open a new page in a specific Frame. So far, the click just opens new page in frame where button is.The code I have so far is:

<input type="button" width="140" value="Offers" onclick="document.location='Spare.html';" FrameTarget="Content">

Guidance pleaseBuoka

Link to comment
Share on other sites

Have settled on wishing "Button" rather than "Input", so code now looks:-

<button name="std" type="button" onclick="document.location='Standard.html';" FrameTarget="Content"> Standard Range</button><br />

I guess same issue though of how to get the "Target" or "FrameTarget" to point at my "Content" Frame.Over to you guys

Link to comment
Share on other sites

If your frame has an id of "Content" then rather than doing:

document.location='Standard.html';

You can use something like:

document.getElementById('Content').src='Standard.html';

Then you won't have to worry about setting a target (which, I believe, only works with "a" elements).

Link to comment
Share on other sites

Thanks Jesh, but clearly have my thick head on this morning.new code:

<button name="std" type="button" onclick="document.getElementById('Content').src='Standard.html';"> Standard Range</button>

Doesn't do anything. What have I missed?

Link to comment
Share on other sites

Thanks Jesh, but clearly have my thick head on this morning.new code:
<button name="std" type="button" onclick="document.getElementById('Content').src='Standard.html';"> Standard Range</button>

Doesn't do anything. What have I missed?

Thanks Jesh, but clearly have my thick head on this morning.new code:CODE<button name="std" type="button" onclick="document.getElementById('Content').src='Standard.html';"> Standard Range</button>Doesn't do anything. What have I missed?
Link to comment
Share on other sites

  • 2 weeks later...

Hi again, Jesh.Whole code for this page of HTML is:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html>  <head>    <meta http-equiv="content-type" content="text/html; charset=windows-1250">    <meta name="generator" content="PSPad editor, www.pspad.com">    <link REL=StyleSheet HREF="Style.css" TYPE="text/css" MEDIA=screen>    <title>Menu</title>  </head>  <body>    <fieldset>      <legend align="center"><strong>Introduction & Benefits</strong></legend>      <div align="center">      <button type="button" onclick="document.location='Benefits.html';" FrameTarget="Content"> Benefits</button></div><br />      </fieldset><br />      <fieldset>      <legend align="center"><strong>Hot Tub Spas</strong></legend>      <div align="center">      <button type="button" onclick="document.getElementById('Content').src='Standard.html';"> Standard Range</button><br />      <button type="button" onclick="document.location='Premier.html';" FrameTarget="Content"> Premier Range</button><br />      <button type="button" onclick="document.location='Platinum.html';" FrameTarget="Content"> Platinum Range</button><br />      <button type="button" onclick="document.location='FAQs.html';" FrameTarget="Content"> Hot Tub Spa FAQs</button></div><br />      </fieldset><br />      <fieldset>      <legend align="center"><small><strong>Saunas, Gazebos & Decking</strong></small></legend>      <div align="center">      <button type="button" onclick="document.location='Spare.html';" FrameTarget="Content"> Saunas</button><br />      <button type="button" onclick="document.location='Spare.html';" FrameTarget="Content"> Gazebos & Decking</button><br />      <button type="button" onclick="document.location='Spare.html';" FrameTarget="Content"> Sauna FAQs</button></div><br />      </fieldset><br /><br />  </body></html>

Can you, or anyone assist now please?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...