Passing values between frames

Results 1 to 2 of 2

Thread: Passing values between frames

  1. #1
    Rob Reid Guest

    Default Passing values between frames

    I have a page split into two frames and I need to know how pass a value and submit the form in one frame when an event fires in the other frame. I have a dropdown box in the top frame and when the value changes in the list I need to pass that new value into the second frame and submit the form as the second frame uses that value to get data from a database. How do I do this????

  2. #2
    sm549 Guest

    Default RE: Passing values between frames

    You could write an OnChange event handler for the &#060;select&#062;, maybe like this.<BR><BR>function changeHandler(){<BR>&nbsp&nbsp//put selected option text into a hidden tag in other frame <BR><BR>&nbsp&nbspparent.frames["otherframename"].document.forms[0].txtHidden = <BR>&nbsp&nbsp&nbsp&nbspdocument.forms[0].ctlSelect.options[<BR>&nbsp&nbsp&nbsp&nbspdocument.forms[0].ctlSelect.selectedIndex].text;<BR><BR>&nbsp&nbsp//Then submit to the server.<BR>&nbsp&nbspparent.frames["otherframename"].document.forms[0].submit();<BR>}<BR><BR>&#060;!--Give your frames names so they can reference each other--&#062;<BR>&#060;FRAMESET COLS="35%,*" FRAMEBORDER = "0"&#062;<BR>&nbsp&nbsp&#060;FRAME name="topframe" Src="top.asp"&#062;<BR>&nbsp&nbsp&#060;FRAME name="otherframename" Src="other.asp"&#062;<BR>&#060;/FRAMESET&#062;<BR><BR>Hope it helps.<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts