Ok Thanks Ron, I'll give this a try. If I can't get it to work...I'll let you know..
Thanks Again
Ron <webmaster@slider142.com> wrote in message news:<NGhmc.147072$Gd3.36163147@news4.srv.hcvlny.c v.net>...[color=blue]
> Heya Trvl,
> There were quite a few errors in both HTML and javascript. Note that
> frames are no longer supported in XHTML, so you may as well get used to
> coding without them. The object element in combination with simple
> javascript allows similar functionality. Instead of a frameset document,
> you should have this:
>
> <?xml version="1.0"?>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
> "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
> <head>
> <meta http-equiv="Content-Type" content="application/xhtml+xml" />
> <meta http-equiv="Content-Script-Type" content="text/javascript" />
> <title>Untitled</title>
> <!--All the lines above are required for XHTML documents that use
> intrinsic javascript events. Copy
> them to a file you can use for a template; don't bother memorizing
> it. The template should end with
> </head><body></body></html>. These are all required elements.-->
> <style type="text/css">
> #left {
> float:left;
> }
> #right {
> float:right;
> }
> </style>
> <!--The language attribute is deprecated in favor of MIME type-->
> <script type="text/javascript">
> var rightDoc = null;
>
> function getUserName() {
> var username = window.prompt("Welcome to Exercise 8-2", "Enter
> your name here");
> var rightText = rightDoc.createTextNode(username + "Welcome to
> Exercise 8-2");
> rightDoc.body.appendChild(rightText);
> rightDoc.body.normalize();
> /* In almost all cases, it is bad form to use document.write()
> unless one knows exactly what they are doing.
> This function was moved here because it needs to run after the
> right frame has finished loading. You'll
> notice with javascript that if you call elements before they have
> been loaded, they will always be null.
> Learn more about the standard methods above at
>
http://www.w3.org/TR/DOM-Level-3-Core .
> Note that as of this date, no browsers implement properties and
> methods introduced in Level 3 Core. */
> }
>
> function setRightDoc() {
> rightDoc = document.getElementById('right').contentDocument;
> }
> </script>
> </head>
> <body onload="setRightDoc();getUserName()">
> <object id="left" data="Left8-2.xhtml"
> type="application/xhtml+xml" height="600" width="50%"></object>
> <object id="right" data="Right8-2.xhtml"
> type="application/xhtml+xml" height="600" width="50%"></object>
> </body>
> </html>
>
> Note how all tag names and attributes are in lower-case, and all tags
> are closed. Now you'll want to modify Left8-2.xhtml to be the following:
>
> <?xml version="1.0"?>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
> "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
> <head>
> <meta http-equiv="Content-Type" content="application/xhtml+xml" />
> <meta http-equiv="Content-Script-Type" content="text/javascript" />
> <title>Exercise Left8-2 - LEFT FRAME PAGE with Document
> Object </title>
> <script type="text/javascript">
> function checkField(field) {
> if (field.value == "") {
> window.alert("Please enter a Back ground Color");
> field.focus ();
> }
> }
>
> function changeRightTo(value) {
> var rightDoc =
> parent.document.getElementById("right").contentDoc ument;
> if(document.implementation.hasFeature("CSS2", "2.0")) {
> rightDoc.body.style.setProperty("background-color", value,
> "important");
> }
> }
> </script>
> <style type="text/css">
> h2 {
> text-align:center;
> font-family:Arial, sans-serif;
> color:green;
> }
> .my-form {
> text-align:center;
> font-family:Arial, sans-serif;
> font-size:small;
> color:green;
> }
> </style>
>
> <!--All tags must be closed. Empty tags can be closed by adding a
> slash before the closing '>' of the tag-->
> </head>
> <body>
>
> <!-- Headings are structural, not aesthetic. If you don't like the
> heading style, use stylesheets, but
> never put heading numbers out of order simply for aesthetic reasons-->
> <h1>This is the left document of Exercise 8-2</h1>
>
> <!--The font element is no longer supported. Use stylesheets to
> effect document aesthetics-->
> <h2>Exercise 8-2 -JavaScript Buttons</h2>
>
> <!--The center element is no longer supported. Use stylesheets for
> aesthetic positioning.-->
> <!--For most top-level elements, the functionality of name has been
> replaced with id. Form components must still use
> name to be successful.-->
> <form id="FrmMyForm" action="Right8-2.html" class="my-form">
>
> <!--It is good form to use label/control structure instead of having
> controls in a sea of unrelated text.-->
> <label for="MyField">Enter a Back Ground Color:</label>
> <input type="text" name="MyField" id="MyField"
> onblur="checkField(this)" />
>
> <!--The button element allows greater flexibility than the input
> element of type button-->
> <button type="button" name="Userbutton"
> onclick="changeRightTo(document.getElementById('My Field').value)">
> Change Back Ground Color
> </button>
> <button type="button" value="red" name="redbutton"
> onclick="changeRightTo(this.value)">
> Change to Red!
> </button>
> <br />
> <button type="button" value="yellow" name="yellowbutton"
> onclick="changeRightTo(this.value)">
> Change to Yellow!
> </button>
> <br />
> <button type="button" name="buttonPrint"
> onclick="window.print()">Print</button>
> <button type="button" name="rightbutton"
> onclick="window.location='Right8-2.html'">
> Go to the Right Page
> </button>
> </form>
> </body>
> </html>
>
> The Right8-2.xhtml file is just an empty XHTML document:
>
> <?xml version="1.0"?>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
> "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
> <head>
> <meta http-equiv="Content-Type" content="application/xhtml+xml" />
> <meta http-equiv="Content-Script-Type" content="text/javascript" />
> <title>Exercise Right8-2 - RIGHT FRAME PAGE with Document
> Object</title>
> </head>
> <body>
> </body>
> </html>
>
> You should be able to work from here. Learn more about the current XHTML
> standard at
http://www.w3.org/TR/xhtml11 .[/color]