Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

using a button as a link to different frame

Status
Not open for further replies.

MikeT

IS-IT--Management
Feb 1, 2001
376
US
I have 2 frames on my page; upper.htm and lower.htm.
Using the following code in upper.htm, I use a button as a link, but I cant get it to link to lower.htm.

<input type=button value=&quot;Click me&quot; onclick=&quot;document.location=page2.htm'&quot;>

(I want page2.htm to replace lower.htm, and upper.htm to remain the same.)

I know this can be done with the <a href...> method, but I don't want to do it that way.
Is this possible?
 
Mike,
Try this - I think this should work.

<INPUT type=&quot;button&quot; name=button1 onclick = &quot;parent.frames[1].document.location.href = 'page2.htm';&quot; value = &quot;Go to Page 2&quot;>


Julie
 
Or you can always set the Target=&quot;<frame name>&quot; to display in that frame. &quot;It's easier to ask forgiveness than it is to get permission.&quot; - Rear Admiral Dr. Grace Hopper
 
This is what worked:
<INPUT type=&quot;button&quot; name=button1 target=&quot;bottom&quot; onclick=&quot;parent.frames[1].location='page1.htm';&quot; value = &quot;Click&quot;>

Thanks for your help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top