Writing results in two different frames.

Results 1 to 2 of 2

Thread: Writing results in two different frames.

  1. #1
    Join Date
    Dec 1969
    Posts
    105

    Default Writing results in two different frames.

    How can the results of a query be written to two different frames on the same page? Ex:One page has three frames-top,middle,bottom. I want to submit some information into the middle and bottom pages. It is like posting to two different pages at once. I saw the previous response to a similar question, but that only writes to one page, the middle one.

  2. #2
    Join Date
    Dec 1969
    Posts
    35

    Default RE: Writing results in two different frames.

    Okay heres how you go about doing this project. The theory is to have the top frame submit some information to the middle frame of the bottom frame(in my example it submits to the middle frame), then have the second frame submit information to the other frame from a form that&#039s hidden from the user. I did a simple example of passing a persons zip code in numeric and text form:<BR>the frameset page:<BR>&#060;HTML><BR>&#060;head><BR>&#060;TITLE >frameset&#060;/TITLE><BR>&#060;/HEAD><BR>&#060;frameset framespacing="0" frameborder="no" border=0 rows="25%,*,20%"><BR> &#060;frame name="top" src="top.html" scrolling="no"><BR> &#060;frame name="middle" src="middle.html"><BR> &#060;frame name="bottom" src="bottom.html" scrolling="no"><BR> &#060;noframes><BR> &#060;body><BR> &#060;/body><BR> &#060;/noframes><BR>&#060;/frameset><BR>&#060;/HTML><BR><BR>the top frame (HTML):<BR>&#060;HTML><BR>&#060;BODY><BR>&#060;for m name="Top" action="middle.asp" method="post" target="middle"><BR>Please enter your zip code from the five boxes below<BR><BR>&#060;select name="ZipNum1"><BR> &#060;option value="1">one<BR> &#060;option value="2">two<BR> &#060;option value="3">three<BR> &#060;option value="4">four<BR> &#060;option value="5">five<BR> &#060;option value="6">six<BR> &#060;option value="7">seven<BR> &#060;option value="8">eight<BR> &#060;option value="9">nine<BR> &#060;option value="0">zero<BR>&#060;/select><BR>&#060;select name="ZipNum2"><BR> &#060;option value="1">one<BR> &#060;option value="2">two<BR> &#060;option value="3">three<BR> &#060;option value="4">four<BR> &#060;option value="5">five<BR> &#060;option value="6">six<BR> &#060;option value="7">seven<BR> &#060;option value="8">eight<BR> &#060;option value="9">nine<BR> &#060;option value="0">zero<BR>&#060;/select><BR>&#060;select name="ZipNum3"><BR> &#060;option value="1">one<BR> &#060;option value="2">two<BR> &#060;option value="3">three<BR> &#060;option value="4">four<BR> &#060;option value="5">five<BR> &#060;option value="6">six<BR> &#060;option value="7">seven<BR> &#060;option value="8">eight<BR> &#060;option value="9">nine<BR> &#060;option value="0">zero<BR>&#060;/select><BR>&#060;select name="ZipNum4"><BR> &#060;option value="1">one<BR> &#060;option value="2">two<BR> &#060;option value="3">three<BR> &#060;option value="4">four<BR> &#060;option value="5">five<BR> &#060;option value="6">six<BR> &#060;option value="7">seven<BR> &#060;option value="8">eight<BR> &#060;option value="9">nine<BR> &#060;option value="0">zero<BR>&#060;/select><BR>&#060;select name="ZipNum5"><BR> &#060;option value="1">one<BR> &#060;option value="2">two<BR> &#060;option value="3">three<BR> &#060;option value="4">four<BR> &#060;option value="5">five<BR> &#060;option value="6">six<BR> &#060;option value="7">seven<BR> &#060;option value="8">eight<BR> &#060;option value="9">nine<BR> &#060;option value="0">zero<BR>&#060;/select><BR><BR><BR><BR>&#060;input type=submit value="Submit"><BR>&#060;/form><BR>&#060;/BODY><BR>&#060;/HTML><BR><BR>the middle frame (HTML):<BR>&#060;HTML><BR>&#060;BODY><BR>this is a place holder<BR>&#060;/BODY><BR>&#060;/HTML><BR><BR>the middle frame (ASP):<BR>&#060;%@ Language=javascript &#037;&#062;<BR>&#060;%<BR>//this gets the selection from the combo that&#039s in the top panel<BR>var wordArray=new Array();<BR>var numArray=new Array();<BR>var i=0;<BR>var j;<BR>var keyName;<BR>while (i&#060;Request.Form.Count){<BR> keyName=Request.Form.Key(i+1);<BR> numArray[i]=Request.Form(keyName);<BR> i++;<BR>}<BR>for(i=0; i&#060;numArray.length; i++){<BR> if (numArray[i]==0)<BR> wordArray[i]="zero";<BR> else if (numArray[i]==1)<BR> wordArray[i]="one";<BR> else if (numArray[i]==2)<BR> wordArray[i]="two";<BR> else if (numArray[i]==3)<BR> wordArray[i]="three";<BR> else if (numArray[i]==4)<BR> wordArray[i]="four";<BR> else if (numArray[i]==5)<BR> wordArray[i]="five";<BR> else if (numArray[i]==6)<BR> wordArray[i]="six";<BR> else if (numArray[i]==7)<BR> wordArray[i]="seven";<BR> else if (numArray[i]==8)<BR> wordArray[i]="eight";<BR> else if (numArray[i]==9)<BR> wordArray[i]="nine";<BR>}<BR> <BR>//this writes the middle frame.<BR>&#037;&#062;<BR>&#060;HTML><BR>&#060;BOD Y><BR>&#060;form name="middle"><BR>&#060;%Numeric="" + numArray[0] + numArray[1] + numArray[2] + numArray[3] + numArray[4];&#037;&#062;<BR>This is you zip code in numeric form:<BR><BR>&#060;input type=text name=numeric value="&#060;%=Numeric&#037;&#062;" readonly><BR>&#060;/form><BR>&#060;form name=passedData><BR>&#060;%<BR>//this creates a bunch of hidden inputs that are submited<BR>//to the bottom frame.<BR>var j=0;<BR>while (j&#060;wordArray.length){<BR> Response.Write("&#060;input type=\"hidden\" name=\"" + wordArray[j] + j + "\" value=\"" + wordArray[j] + "\">
    ");<BR> j++;<BR>}<BR>&#037;&#062;<BR>&#060;/form><BR>&#060;script language=javascript><BR>var head=window.document.passedData;<BR>head.action="b ottom.asp";<BR>head.method="post";<BR>head.target= "bottom";<BR>head.submit();<BR>&#060;/script><BR>&#060;/body><BR>&#060;/HTML><BR><BR>the bottom frame (HTML):<BR>&#060;HTML><BR>&#060;BODY><BR>&#060;for m name="bottom"><BR>place holder<BR>&#060;/form><BR>&#060;/BODY><BR>&#060;/HTML><BR><BR>the bottom frame(ASP):<BR>&#060;%@ Language=javascript &#037;&#062;<BR>&#060;%<BR>var wordArray = new Array();<BR>var i=0;<BR>var keyName;<BR>while (i&#060;Request.Form.Count){<BR> keyName=Request.Form.Key(i+1);<BR> wordArray[i]=Request.Form(keyName);<BR> i++;<BR>}<BR>&#037;&#062;<BR>&#060;HTML><BR>&#060; BODY><BR>Your zip code in word form is:<BR><BR>&#060;%<BR>for (i=0; i&#060;wordArray.length; i++){<BR> Response.Write(wordArray[i]+"--")<BR>}<BR>&#037;&#062;<BR>&#060;/BODY><BR>&#060;/HTML><BR><BR>I hope that this works for you. Happy Programming =)

Posting Permissions

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