Click to See Complete Forum and Search --> : post to multiple frames...
ink777
November 28th, 2003, 06:43 AM
Hi,
I have an html page with 3 frames ie. 1 frame on the left and 2(top and bottom) on the right.
I have 2 buttons on the left frame. Depending on the button clicked, I need to bring up different pages on the top and bottom frames. Right now, I am only able to post to the top frame with
<form method="post" action="pagecm.jsp" target="RIGHTTOP">.
How can I change the contents of the bottom page i.e RIGHTBOTTOM at the same time? Is there any way to post to multiple pages??
Thanks.
professorX
November 29th, 2003, 04:25 AM
Perhaps, You try it:
<form name="frmPost" id="frmPost" method="post" action="pagecm.jsp">
<input name="frRightTop" type="hidden" value="RIGHTTOP"/>
<input name="frRightBottom" type="hidden" value="RIGHTTBOTTOM"/>
<a href="document.getElementById('frmPost').submit();">Post</a>
</form>
And in pagecm.jsp You refresh frames...
Or You can try use 2 forms:
<form name="frmPost" id="frmPost" method="post" action="pagecm.jsp" target="RIGHTTOP">
//form's elements
</form>
<form name="frmPost2" id="frmPost2" method="post" action="pagecm.jsp" target="RIGHTBOTTOM">
//form's elements
</form>
<a href="document.getElementById('frmPost').submit();document.getElementById('frmPost2').submit();">Post</a>
But I'm not sure, that it works...
ink777
December 1st, 2003, 07:32 AM
Hi,
Thanks! The first option is not what I had wanted. The second option didn't work! Any other way of letting more than one page or frame know that I have clicked a button in one of the pages?
This is how I am creating frames.
/******/
<html>
</HEAD>
<FRAMESET COLS="20%,80%">
<FRAME SRC="page1.jsp" SCROLLING=no NAME="LEFT">
<FRAMESET ROWS="11%,89%">
<FRAME SRC="pagetm.jsp" SCROLLING=no NAME="RIGHTTOP">
<FRAME SRC="Home.jsp" NAME="RIGHTBOTTOM">
</FRAMESET>
<NOFRAMES>
<BODY>
Sorry cannot see frames <a href="noframe.htm">
click here for no frame version</a>
</BODY>
</NOFRAMES>
</HTML>
/*****/
I have 2 buttons in 'page1.jsp' . When I click on any button in this page, I want to change the contents of both the RIGHTTOP and RIGHTBOTTOM pages. How do I do that?
Thanks.
professorX
December 1st, 2003, 08:12 AM
I don't know, work it or not, because I'm not work with frames long time, but You can try:
1)
<a href="javascript:;" onclick="document.frames['RIGHTTOP'].location.href = 'OtherPage.html';document.frames['RIGHTBOTTOM'].location.href = 'OtherPageElse.html'">button 1</a>
or:
2)
<a href="javascript:;" onclick="document.frames['RIGHTTOP'].src = 'OtherPage.html';document.frames['RIGHTBOTTOM'].src = 'OtherPageElse.html'">button 1</a>
But I think, that 1) way is better.
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.