Quick help please with FRAMES (another question)

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • TrvlOrm

    Quick help please with FRAMES (another question)

    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>Exerci se Left8-2 - LEFT FRAME PAGE with Document Object</TITLE>

    <SCRIPT LANGUAGE="JavaS cript">

    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="JavaS cript">

    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(MyFi eldData);">
    Enter a Back Ground Color:
    <INPUT TYPE="text" Name="MyFieldDa ta" onBlur="">
    <INPUT TYPE="Submit">

    <INPUT TYPE="button" VALUE="Change Back Ground Color" NAME="MyField"
    onClick="rightF rame.bgColor='b lue' ">

    <INPUT type="button" value="Change to Red!" name="redbutton "
    onClick="rightF rame.bgColor='r ed'"> <br>

    <INPUT type="button" value="Change to Yellow!" name="yellowbut ton"
    onClick="rightF rame.bgColor='y ellow'"> <br>

    <INPUT type="button" VALUE="Change to Blue!" NAME="Bluebutto n"
    onClick="rightF rame.bgColor='b lue'"><BR>

    <INPUT TYPE="button" NAME="buttonPri nt" VALUE="Print"
    onClick="rightD oc.print()">

    <INPUT type="button" value="Go to the Right Page" name="rightbutt on"
    onClick="rightF rame.location=' Right8-2.html'">

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

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

    <TITLE>Exerci se 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>Exerci se 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........
  • Erwin Moller

    #2
    Re: Quick help please with FRAMES (another question)

    42

    Comment

    • Trvl Orm

      #3
      Re: Quick help please with FRAMES (another question)


      Sorry Erwin.....What is 42 ?


      *** Sent via Developersdex http://www.developersdex.com ***
      Don't just participate in USENET...get rewarded for it!

      Comment

      • Richard Cornford

        #4
        Re: Quick help please with FRAMES (another question)

        Trvl Orm wrote:[color=blue]
        > Sorry Erwin.....What is 42 ?[/color]

        The answer.

        The answer to what?

        Life, the Universe ... everything.

        - from: "The Hitchhiker's Guide to the Galaxy" by Douglas Adams. :)

        Probably intended to imply that your question was vague. (I cannot tell
        because I haven't read your question, you have been top posting too much
        recently to warrant that).

        Richard.


        Comment

        • Trvl Orm

          #5
          Re: Quick help please with FRAMES (another question)

          Richard, it shouldn't matter how many posts a person does on this forum,
          if they are seeking help.

          I've posted because like many others, and seeking answers to my
          question.



          *** Sent via Developersdex http://www.developersdex.com ***
          Don't just participate in USENET...get rewarded for it!

          Comment

          • Randy Webb

            #6
            Re: Quick help please with FRAMES (another question)

            Trvl Orm wrote:
            [color=blue]
            > Richard, it shouldn't matter how many posts a person does on this forum,
            > if they are seeking help.
            >
            > I've posted because like many others, and seeking answers to my
            > question.
            >[/color]

            What you have *not* done (like many others) is to consult the FAQ (URL
            is in my signature) on proper posting style, what is the "norm" in this
            group, and how to quote what you are replying to.

            Adhering to those accepted standards will go a *long* way in getting you
            an answer.

            --
            Randy
            Chance Favors The Prepared Mind
            comp.lang.javas cript FAQ - http://jibbering.com/faq/

            Comment

            • Trvl Orm

              #7
              Re: Quick help please with FRAMES (another question)

              Ok...I am new at this JavaScript thing and new to the forum, so please
              forgive me if I am missing something here....but what have I not done?

              Is there some one who can please provide me with some help to my
              problem?



              *** Sent via Developersdex http://www.developersdex.com ***
              Don't just participate in USENET...get rewarded for it!

              Comment

              • kaeli

                #8
                Re: Quick help please with FRAMES (another question)

                In article <409be2ee$0$205 $75868355@news. frii.net>, ksorman@shaw.ca
                enlightened us with...[color=blue]
                > Ok...I am new at this JavaScript thing and new to the forum, so please
                > forgive me if I am missing something here....but what have I not done?[/color]

                Well, for starters, you're getting this off Developersdex and thinking
                everyone else is, too.
                This is Usenet. Not a "forum". It's a forum for YOU because you aredn't
                using a newsreader like most of use here.

                Also, when you post, you are supposed to quote what you're talking about
                before you reply to it.
                See my post here. I quoted you above.
                That way, people know what the hell I'm talking about. :)[color=blue]
                >
                > Is there some one who can please provide me with some help to my
                > problem?
                >[/color]

                Well, since you didn't quote it and newsservers don't always keep the
                beginning of a thread, what IS your problem? ;)

                I see a couple things right away.
                Frames are windows. Documents are in windows. This is misleading.
                [color=blue]
                > var leftFrame = top.frames[0].document;
                > var rightFrame = top.frames[1].document;
                > var rightDoc = top.frames[1];[/color]

                A frame is a window.
                var leftFrame = top.frames[0];

                If you meant the doc, call it that.
                var leftFrameDoc = top.frames[0].document;

                top.frames[1] is a window, not a document.
                [color=blue]
                > <SCRIPT LANGUAGE="JavaS cript">[/color]
                shoule be
                <SCRIPT LANGUAGE="JavaS cript" type="text/javascript">
                [color=blue]
                > function checkField (field)
                > {
                > if (field.value == "") {[/color]

                It is possible to pass a null field, at which time you'll get a null
                object error for trying to access value. Change to

                function checkField (field)
                {
                if (field == null || field.value == "") {

                Note that that allows blanks. (" ")
                Maybe not so good, eh?

                Better...
                function isBlank(val)
                {
                // True if val is whitespace only or empty.
                var re = /\S+/;
                return (!re.test(val)) ;
                }
                if (! field || isBlank(field.v alue)

                Also note that you forgot to return true for this function in the
                success case.
                [color=blue]
                > <Center>[/color]
                AFAIK, that is deprecated.
                [color=blue]
                > <INPUT type="button" value="Go to the Right Page" name="rightbutt on"
                > onClick="rightF rame.location=' Right8-2.html'">[/color]

                Better to load the whole frameset as one.
                <INPUT type="button" value="Go to the Right Page" name="rightbutt on"
                onClick="top.lo cation='Right8-2.html'">


                Need more help, let me know.

                --
                --
                ~kaeli~
                Black holes were created when God divided by 0.



                Comment

                • Richard Cornford

                  #9
                  Re: Quick help please with FRAMES (another question)

                  Trvl Orm wrote:[color=blue]
                  > Richard, it shouldn't matter how many posts a person
                  > does on this forum, if they are seeking help.[/color]

                  Did anyone say it did?
                  [color=blue]
                  > I've posted because like many others, and seeking
                  > answers to my question.[/color]

                  And like those many others you are in a position to take action to
                  influence the number, nature and quality of the answers you get (the FAQ
                  is very detailed on the subject). Posting to Usenet without any regard
                  for the established conventions is not an action that should be expected
                  to have a positive impact upon the outcome.

                  Richard.


                  Comment

                  • Trvl Orm

                    #10
                    Re: Quick help please with FRAMES (another question)

                    Ok thanks so much Kaeli for your help so far.

                    Yes, if you wouldn't mind I do need a bit more help with my Frames
                    page...Like I said before I am new to JavaScript and this forum, so any
                    help I can get is great.
                    [color=blue]
                    >Well, since you didn't quote it and newsservers don't >always keep the
                    >beginning of a thread, what IS your problem? ;)[/color]

                    My problem has been mentioned in my first post, I am attaching it to
                    this message again, for those of you who can help....

                    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)

                    Any ideas? and thank you so much so far.....

                    (All 3 pages of coding below...)

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

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

                    <SCRIPT LANGUAGE="JavaS cript">

                    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="JavaS cript">

                    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(MyFi eldData);"> Enter a Back Ground Color:
                    <INPUT TYPE="text" Name="MyFieldDa ta" onBlur="">
                    <INPUT TYPE="Submit">

                    <INPUT TYPE="button" VALUE="Change Back Ground Color" NAME="MyField"
                    onClick="rightF rame.bgColor='b lue' ">

                    <INPUT type="button" value="Change to Red!" name="redbutton "
                    onClick="rightF rame.bgColor='r ed'"> <br>

                    <INPUT type="button" value="Change to Yellow!" name="yellowbut ton"
                    onClick="rightF rame.bgColor='y ellow'"> <br>

                    <INPUT type="button" VALUE="Change to Blue!" NAME="Bluebutto n"
                    onClick="rightF rame.bgColor='b lue'"><BR>

                    <INPUT TYPE="button" NAME="buttonPri nt" VALUE="Print"
                    onClick="rightD oc.print()">

                    <INPUT type="button" value="Go to the Right Page" name="rightbutt on"
                    onClick="rightF rame.location=' Right8-2.html'">

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

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

                    <TITLE>Exerci se 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>Exerci se 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........


                    *** Sent via Developersdex http://www.developersdex.com ***
                    Don't just participate in USENET...get rewarded for it!

                    Comment

                    • TrvlOrm

                      #11
                      Still need help

                      Can any one please help me?

                      I may or may not be doing the correct way to post to these forums, but
                      I
                      am very new at this, and not entirely sure what I am doing
                      incorrectly. All I am seeking for is some help to a major problem,
                      which needs to be resolved a s a p...please help....

                      See first post for my problem

                      Thank you.

                      "Richard Cornford" <Richard@litote s.demon.co.uk> wrote in message news:<c7h0bq$pr 2$1$8300dec7@ne ws.demon.co.uk> ...[color=blue]
                      > Trvl Orm wrote:[color=green]
                      > > Richard, it shouldn't matter how many posts a person
                      > > does on this forum, if they are seeking help.[/color]
                      >
                      > Did anyone say it did?
                      >[color=green]
                      > > I've posted because like many others, and seeking
                      > > answers to my question.[/color]
                      >
                      > And like those many others you are in a position to take action to
                      > influence the number, nature and quality of the answers you get (the FAQ
                      > is very detailed on the subject). Posting to Usenet without any regard
                      > for the established conventions is not an action that should be expected
                      > to have a positive impact upon the outcome.
                      >
                      > Richard.[/color]

                      Comment

                      • Richard Cornford

                        #12
                        Re: Still need help

                        TrvlOrm wrote:[color=blue]
                        > Can any one please help me?[/color]

                        Oh yes, many will be able to help you. What you are struggling with at
                        the moment is achieving a coincidence of ability to help and willingness
                        to help.
                        [color=blue]
                        > I may or may not be doing the correct way to post to these
                        > forums, but I am very new at this, and not entirely
                        > sure what I am doing incorrectly.[/color]

                        One of the accusations levelled against individuals who top-post over
                        verbatim quotes is that they display evidence of having not bothered to
                        actually read the messages that they are replying to. If you review the
                        responses that you have received on this group to date you will find a
                        recurrent theme (in the form of an acronym), and you will find that
                        there is a reason that it is recurrent.
                        [color=blue]
                        > All I am seeking for is some help to a major problem,
                        > which needs to be resolved a s a p...please help....
                        >
                        > See first post for my problem[/color]

                        So you have decided to react to the suggestion that your original
                        question may have been too vague to actually be answered by just
                        referring people back to it? (Incidentally, changing the subject line
                        will have resulted in your original post being disassociated from your
                        last message at groups.goolgle. com)

                        <snip>[color=blue][color=green]
                        >> ... (the FAQ is very detailed on the subject). ...[/color][/color]
                        <snip>

                        Richard.


                        Comment

                        • Dr John Stockton

                          #13
                          Re: Still need help

                          JRS: In article <fa9bacd0.04050 82012.5b041fc7@ posting.google. com>, seen
                          in news:comp.lang. javascript, TrvlOrm <ksorman@shaw.c a> posted at Sat, 8
                          May 2004 21:12:21 :
                          [color=blue]
                          >I may or may not be doing the correct way to post to these forums, but
                          >I
                          >am very new at this, and not entirely sure what I am doing
                          >incorrectly. All I am seeking for is some help to a major problem,
                          >which needs to be resolved a s a p...please help....
                          >
                          >See first post for my problem[/color]
                          [color=blue]
                          >"Richard Cornford" <Richard@litote s.demon.co.uk> wrote in message news:<c7h0bq$p
                          >r2$1$8300dec7@ news.demon.co.u k>...[color=green]
                          >> ...[/color][/color]


                          Do not top-post. Do not over-quote. Don't quote signatures.

                          Read the newsgroup FAQ until you are reasonably familiar with what is in
                          Section 4, and have a thorough understanding of Section 2.3.

                          Once you demonstrate that you can do that, you will find that the
                          knowledgeable readers here will be better able, and more willing, to
                          help with scripting problems.

                          --
                          © John Stockton, Surrey, UK. ?@merlyn.demon. co.uk Turnpike v4.00 IE 4 ©
                          <URL:http://jibbering.com/faq/> Jim Ley's FAQ for news:comp.lang. javascript
                          <URL:http://www.merlyn.demo n.co.uk/js-index.htm> jscr maths, dates, sources.
                          <URL:http://www.merlyn.demo n.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.

                          Comment

                          • Shawn Milo

                            #14
                            Re: Still need help

                            Here is something which should be read
                            by anyone posting questions to usenet:


                            Comment

                            • kaeli

                              #15
                              Re: Quick help please with FRAMES (another question)

                              In article <409c0aeb$0$206 $75868355@news. frii.net>, ksorman@shaw.ca
                              enlightened us with...[color=blue]
                              > Ok thanks so much Kaeli for your help so far.
                              >[/color]
                              You're welcome.

                              Here. Watch for word-wrap.

                              <HTML>
                              <HEAD>

                              <TITLE>Exerci se 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>


                              <HTML>
                              <HEAD>

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

                              <SCRIPT LANGUAGE="JavaS cript" type="text/javascript">

                              var leftFrame = top.frames['LeftFrame'].document;
                              var rightFrame = top.frames['RightFrame'].document;
                              var rightDoc = top.frames['RightFrame'];

                              function checkField (field)
                              {
                              if (field.value == "")
                              {
                              alert("Please enter a Background Color");
                              field.focus();
                              return false; // don't submit the form
                              }
                              return true;
                              }

                              </SCRIPT>
                              </HEAD>

                              <BODY>

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

                              <SCRIPT LANGUAGE="JavaS cript" type="text/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 ">
                              Enter a Back Ground Color: <INPUT TYPE="text" Name="MyFieldDa ta">&nbsp;
                              <INPUT TYPE="button" onClick="if (checkField(thi s.form.MyFieldD ata))
                              rightFrame.bgCo lor=this.form.M yFieldData.valu e;" value="Submit"> <br>

                              <INPUT TYPE="button" VALUE="Change Back Ground Color" NAME="MyField"
                              onClick="rightF rame.bgColor='b lue' "><br>
                              <INPUT type="button" value="Change to Red!" name="redbutton "
                              onClick="rightF rame.bgColor='r ed'"> <br>
                              <INPUT type="button" value="Change to Yellow!" name="yellowbut ton"
                              onClick="rightF rame.bgColor='y ellow'"> <br>
                              <INPUT type="button" VALUE="Change to Blue!" NAME="Bluebutto n"
                              onClick="rightF rame.bgColor='b lue'"><BR>
                              <INPUT TYPE="button" NAME="buttonPri nt" VALUE="Print"
                              onClick="rightD oc.print()"><br >
                              <INPUT type="button" value="Go to the Right Page" name="rightbutt on"
                              onClick="top.lo cation='Right8-2.html'">

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


                              <HTML>
                              <HEAD>

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

                              <body>

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

                              </body>
                              </HTML>


                              --
                              --
                              ~kaeli~
                              I love God.
                              It's His fanclub that I can't stand.



                              Comment

                              Working...