Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
  1. #1
    New to the CF scene
    Join Date
    May 2004
    Location
    Canada
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy Problem with Frames

    OK. After much playing around, I managed to get my frame page this far.. see code below.

    BUT...there are still errors with it, and what I would like to have happened is this:

    1) On the Left Frame (File LeftEx8_2.html) a series of buttons, which when clicked prompt the user to enter information for background color, text color, link color, title and some text.

    BUT HERE IS MY PROBLEM: some buttons have been started in the left frame, but not all of them and when clicked all the above listed information should show up on the Right frame.

    2) Left frame should also have a button to go to the Right frame (File RightEx8_2.html) page.

    The contents of the LEFT frame should be present on the RIGHT frame, when the final click of a button has been pushed by the user. (File: Ex8_2.html)

    So....How do I get all this to work? I have had tremendous help so far, although not quite what I have been looking for..anyways I'm really confused on this and am seeking help please.....

    I noted on some of the responses, people have been quoting XHTML. I am a new Javascript user (and perfer this page to be done without a cascading style sheet, and XHTML. Just plain HTML please)..I have to use Notepad for creating the script, and Internet Explorer version 6.0 to view what had been created.

    Any ideas?
    (All 3 pages of coding below...)

    //* This is the LEFT FRAME PAGE *\\
    <HTML>
    <HEAD>

    <TITLE>Exercise Left8-2 - LEFT FRAME PAGE with Document Object</TITLE>

    <SCRIPT LANGUAGE="JavaScript">

    var leftFrame = top.frames[0].document;
    var rightFrame = top.frames[1].document;
    var rightDoc = top.frames[1];

    function checkField (field)
    {
    if (field.value == "") {
    alert("Please enter a Back ground Color");

    field.focus();
    return false; // don't submit the form
    }

    }

    </SCRIPT>
    </HEAD>

    <BODY>

    <H3>This is the left document of Exercise 8-2</H3>

    <SCRIPT LANGUAGE="JavaScript">

    var username = prompt("Welcome to Exercise 8-2", "Enter your name here");
    // alert("Welcome to Exercise 8-2");

    document.write(username + " Welcome to Exercise 8-2");

    </SCRIPT>

    <H1 Align=center> <Font Face=Arial Color=Green> Exercise 8-2 - JavaScript Buttons </Font></H1>
    <Center>
    <Font Face=Arial Size=3 Color=Green>

    <FORM NAME="FrmMyForm" action="Right8-2.html" onSubmit = "return checkField(MyFieldData);">
    Enter a Back Ground Color:
    <INPUT TYPE="text" Name="MyFieldData" onBlur="">
    <INPUT TYPE="Submit">

    <INPUT TYPE="button" VALUE="Change Back Ground Color" NAME="MyField" onClick="rightFrame.bgColor='blue' ">

    <INPUT type="button" value="Change to Red!" name="redbutton" onClick="rightFrame.bgColor='red'"> <br>

    <INPUT type="button" value="Change to Yellow!" name="yellowbutton" onClick="rightFrame.bgColor='yellow'"> <br>

    <INPUT type="button" VALUE="Change to Blue!" NAME="Bluebutton" onClick="rightFrame.bgColor='blue'"><BR>

    <INPUT TYPE="button" NAME="buttonPrint" VALUE="Print" onClick="rightDoc.print()">

    <INPUT type="button" value="Go to the Right Page" name="rightbutton" onClick="rightFrame.location='Right8-2.html'">

    </FORM>
    </BODY>
    </HTML>

    //*This is the RIGHT frame Page*\\
    <HTML>
    <HEAD>

    <TITLE>Exercise Right8-2 - Right FRAME PAGE with Document Object</TITLE>
    </head>

    <body>

    <H3>This is the right document of Exercise 8-2</H3>

    </body>
    </HTML>

    //*and This is the MAIN Frame Page - Ex8_2.html*\\
    <HTML>
    <HEAD>

    <TITLE>Exercise 8-2 - FRAME PAGE with Document Object</TITLE>

    </HEAD>

    <FRAMESET COLS="50%,50%">

    <FRAME NAME=LeftFrame SRC="Left8-2.html" name= "lFr">
    <FRAME NAME=RightFrame SRC="Right8-2.html" name = "rFr">
    </FRAMESET>
    </HTML>

    That's it. Would appreaciate any help on this........
    Last edited by TrvlOrm; 05-09-2004 at 06:14 AM. Reason: Change Title


 

Posting Permissions

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