Results 1 to 9 of 9

Thread: breaking out of frames question, (I ADDED TO POST WITH PICS) code posted

  1. #1

    Thread Starter
    Registered User Virus00110's Avatar
    Join Date
    Jul 2002
    Location
    Williamsport, PA
    Posts
    290

    breaking out of frames question, (I ADDED TO POST WITH PICS) code posted

    I have a frame page that hase a contents side where the menu is and a main side where everything else is seen. now the one page i go to that is displayed in the main frame is split into two frames one being named topFrame and the other being name bottomFrame. the top frame is for the title and for two buttons that i want to always be on top, which are an add button and a purge old data button and the bottom shows records that are in the database that can be edited and you can scroll up and down in that frame. now when i click on the button to add a new record i want it to fill the main frame which is displaying the topFrame and bottomFrame at this point. how can i break out of the two frames top and bottom and display in the main frame the screen to add a new record when i click the add button that is in the topFrame? I hope this makes sense if not let me know and i will explain it better or put a diagram up to show you what i want. any help will be greatly appreciated. thanks in advance.
    Last edited by Virus00110; Jun 20th, 2003 at 10:08 AM.

  2. #2

    Thread Starter
    Registered User Virus00110's Avatar
    Join Date
    Jul 2002
    Location
    Williamsport, PA
    Posts
    290
    what it looks like at the start
    Attached Images Attached Images  

  3. #3

    Thread Starter
    Registered User Virus00110's Avatar
    Join Date
    Jul 2002
    Location
    Williamsport, PA
    Posts
    290
    this is what i want it to look like after i click the add button.
    Attached Images Attached Images  

  4. #4
    Fanatic Member davebat's Avatar
    Join Date
    Dec 2002
    Posts
    727
    post your code for the add button and your frameset please

  5. #5
    Frenzied Member andreys's Avatar
    Join Date
    Sep 2002
    Location
    Los Angeles
    Posts
    1,615
    It's not easy to say what to do without looking on your code, but try to add target="_self" within 'Add' button tags:
    Code:
    <input type="button" value="Add" onclick="..." target="_self">

  6. #6

    Thread Starter
    Registered User Virus00110's Avatar
    Join Date
    Jul 2002
    Location
    Williamsport, PA
    Posts
    290
    code for page with add button.

    Code:
    <% LANGUAGE="VBSCRIPT" %>
    <%
    	if session.Contents("access") = "" then
    		response.Redirect("../timeout.asp")
    	elseif session.Contents("access") = "no" then
    		response.Redirect("../noaccess.asp")
    	elseif session.Contents("access") = "yes" then
    		response.Buffer = true
    %>
    <html>
    <head>
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>
    
    <body>
    <center>
    <font size="6"><b>Add/Edit Schedule</b></font>
    </center>
    <br>
    
    <form method="post" action="adedsched.asp">
    	<input type="submit" name="cmdAddSchedule" value="Add Schedule">
    	<input type="submit" name="cmdPurge" value="Purge Old Schedules">
    	<input type="hidden" name="hAdEdSched" value="add">
    </form>
    <hr>
    <br>
    </body>
    </html>
    <% response.Flush() %>
    <% end if %>


    code for frame inside main frame top and bottom frame
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
    <html>
    <head>
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>
    
    <frameset rows="123,*" cols="*" framespacing="0" frameborder="NO" border="0">
      <frame src="apscheduler.asp" name="topFrame" scrolling="NO" noresize >
      <frame src="escheduler.asp" name="bottomFrame">
    </frameset>
    <noframes><body>
    
    </body></noframes>
    </html>

    code for frames that have the menu and the main frame where the top and bottom frame is displayed
    Code:
    <% langauge = "VBScript" %>
    <%
    	dim sTitle
    	dim cnn
    	if session.Contents("access") = "" then
    		response.Redirect("../timeout.asp")
    	elseif session.Contents("access") = "no" then
    		response.Redirect("../noaccess.asp")
    	elseif session.Contents("access") = "yes" then
    	
    		if session.Contents("memtype") = "AI" or session.Contents("memtype") = "AA" then
    			sTitle = "Adult Instructor Member - [Williamsport Sombo Club]"
    		elseif session.Contents("memtype") = "SI" then
    			sTitle = "Student Instructor Member - [Williamsport Sombo Club]"
    		elseif session.Contents("memtype") = "S" then
    			sTitle = "Student Member - [Williamsport Sombo Club]"
    		end if
    		
    		set cnn = server.CreateObject("ADODB.Connection")
    		
    		cnn.open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
    					  "Data Source=" & server.mappath("../../../sdb/sombodb.mdb") & ";" & _
    					  "User Id=admin;Password="
    					  
    		set session.Contents("mcnn") = cnn
    		set cnn = nothing
    %>
    <html>
    
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <title><% response.Write(sTitle)%></title>
    </head>
    
    <frameset framespacing="0" border="0" frameborder="0" cols="210,*">
      <frame name="contents" target="main" src="menu2.asp">
      <frame name="main" src="main.asp" scrolling="no" noresize>
      <noframes>
      <body>
    
      <p>This page uses frames, but your browser doesn't support them.</p>
    
      </body>
      </noframes>
    </frameset>
    
    </html>
    <% end if %>
    last code for page that i want to be displayed in the main frame after the add button is clicked.
    Code:
    <% LANGUAGE="VBSCRIPT" %>
    <%
    
    	if session.Contents("access") = "" then
    		response.Redirect("../timeout.asp")
    	elseif session.Contents("access") = "no" then
    		response.Redirect("../noaccess.asp")
    	elseif session.Contents("access") = "yes" then
    		response.Buffer = true
    %>
    <html>
    <head>
    </head>
    <body>
    <% 
    'test
    call AddSchedule %>
    
    <%
    sub AddSchedule()
    		response.Write("<font size='6'><b>Add New Schedule</font></b>")
    		response.Write("<br>")
    	
    		response.Write("<form method='post' action='../saveschedule.asp'>")
    			response.Write("<b>Date: </b>")
    			response.Write("<input type='text' name='txtDate' value='" & date & "'>")
    			response.Write("<br>")
    			response.Write("<b><u>Lesson:</u></b>")
    			response.Write("<br>")
    			response.Write("<textarea name='textarea' cols='60' rows='15'></textarea>")
    			response.Write("<br>")
    			response.Write("<input type='submit' name='cmdSave' value='Save'>")
    		response.Write("</form>")
    end sub
    %>
    
    <%
    sub EditSchedule()
    	dim cn
    	dim rs
    	dim ssql
    
    end sub
    %>
    </body>
    </html>
    <%
    		'if request.Form("hAdEdSched") = "add" then
    		'	call AddSchedule
    		'elseif request.Form("hAdEdSched") = "edit" then
    		'	call EditSchedule
    		'end if
    	end if
    %>

  7. #7

    Thread Starter
    Registered User Virus00110's Avatar
    Join Date
    Jul 2002
    Location
    Williamsport, PA
    Posts
    290
    if there is no way to get this to work the way i want i will just send that page to the bottom frame. i'm getting to the point where it's just making me mad because i have worked on it for almost the entire week so if you guys can't figure it out no biggy. this is just my last hope. sometimes it helps to have a lot of brains working on something and you guys always do such a great job answering any other question i have. thanks to all of you i've become much smarter

  8. #8
    Frenzied Member andreys's Avatar
    Join Date
    Sep 2002
    Location
    Los Angeles
    Posts
    1,615
    In first code add (IN RED)
    Code:
    <form method="post" action="adedsched.asp" target="_top">
    	<input type="submit" name="cmdAddSchedule" value="Add Schedule">
    	<input type="submit" name="cmdPurge" value="Purge Old Schedules">
    	<input type="hidden" name="hAdEdSched" value="add">
    </form>

  9. #9

    Thread Starter
    Registered User Virus00110's Avatar
    Join Date
    Jul 2002
    Location
    Williamsport, PA
    Posts
    290
    woo hoo that did it. i'm a freaking idiot. thanks i changed it a little bit but that is what i wanted. thanks a lot

Posting Permissions

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



Click Here to Expand Forum to Full Width