faqts : Computers : Programming : Languages : JavaScript : Frames

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

46 of 67 people (69%) answered Yes
Recently 5 of 10 people (50%) answered Yes

Entry

I want to be able to refresh the contents of 2 frames - f1 and f2 - when I press submit button in f2

Apr 22nd, 2002 08:20
Jean-Bernard Valentaten, Kai Chung,


Well, basically te answer to this problem is found in any js-manual, 
but here's the answer anyway:
function refreshFrames(first, second)
{
  eval("parent." + first + ".document.reload()");
  eval("parent." + second + ".document.reload()");
}
and in the onclick-handler of your submit button:
onclick="refreshFrames("nameOfTheFirstFrame", "nameOfTheSecondFrame");"
That's it. I'm sure you'll find out how to use this code and change it 
any way you need.
Jean