title: How do I access the value of a button in a frame from the top level page with javascript?
body: <p>I have a main page that contains a frameset with some frames. I need to access and set the text of a button inside one of my frames from a javascript method in the main page.</p>
  
  <p>I believe its the window.frames that is the issue. It works in IE6 but not in Firefox. Is there something else I can use in place of this to get it to work across all browsers? </p>
  
  <p>Any help would be appreciated.</p>
  
  <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml" &gt;
  &lt;head&gt;
  &lt;title&gt;blah blah&lt;/title&gt;
  &lt;script language="javascript" type="text/javascript"&gt;
  var showString = "show";
  var hash = String(window.location.hash);
  
  function showHideFrames()
  {
  var contentPage;           
  contentPage = hash.substring((showString.length + 2), hash.length);
  var showCheck = hash.substring(1, (showString.length + 1));
  
  // Grab the show or hide
  if (showCheck == showString)
  {
  document.getElementById("outerFrame").cols = "285, *";
  
  window.frames['topFrame'].document.form1.showHideButton.value = "Hide";
  }
  else
  {
  document.getElementById("outerFrame").cols = "0, *";
  
  window.frames['topFrame'].document.form1.showHideButton.value = "Show";
  }
  
  if (contentPage != '') 
  {
  document.getElementById("contentFrame").src = contentPage;
  }
  
  document.getElementById("navFrame").src = "default.aspx?hash=" + contentPage;
  }
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;frameset onLoad="showHideFrames()" name="outerFrame" id="outerFrame" border="0" frameborder="1" framespacing="0" cols="0,*" scrollbars="no"&gt;
  &lt;frame name="navFrame" id="navFrame" scrolling="yes" noresize="noresize" /&gt;
  &lt;frameset name="innerFrame" id="innerFrame" border="0" frameborder="0" framespacing="0" noresize="noresize" rows="40,*"&gt;
  &lt;frame name="topFrame" id="topFrame" src="topFrame.htm" scrolling="no" noresize="noresize" /&gt;
  &lt;frame name="contentFrame" id="contentFrame" scrolling="auto"  /&gt;
  &lt;/frameset&gt;
  &lt;/frameset&gt;
  &lt;/html&gt;
  </code></pre>