T
Trvl Orm
I am working with 2 frames, Left and Right and the main code is in the
left frame, which has been attached.
Can someone please help me with this code. I am new to JavaScript and
can't figure it out.
What needs to happen is this:
On the left frame you should have a series of buttons, which when pushed
makes things happen on the right frame.
1) Prompt the user to enter back ground color, text color, link colors,
title and some lines of text.
2) A button which when pushed shows text, back ground color etc. on the
RIGHT frame...not the LEFT frame.
3) A Script/Prompt box on the left frame, which when the user types in
"What is background Color", say user types in Blue and pushes
submit...it changes the background color to be blue on the RIght frame
and not the left...
What I have done so far, is create buttons to change background color
but it changes it in the LEFT frame and not the RIGHT frame...So my
question is How do I get the buttons and text information to appear on
the Right frame, but created in the left frame.
Confusing isn't it...Is there anyone out there who could help me pretty
promptly???
Thanks so much....
<HTML>
<HEAD>
<TITLE>Exercise Left8-2 - LEFT FRAME PAGE with Document Object</TITLE>
<H3>This is the left document of Exercise 8-2</H3>
<SCRIPT LANGUAGE="JavaScript"
function checkField (field) {
if (field.value == "") {
window.alert("Please enter a Back ground Color");
field.focus ();
}
}
</Script>
<BODY>
<SCRIPT LANGUAGE="JavaScript">
var username = window.prompt("Welcome to Exercise 8-2",
"Enter your name here");
window.prompt("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">
Enter a Back Ground Color:
<INPUT TYPE="text" Name="MyField" onBlur-"checkField(this)")
<INPUT TYPE="Submit">
<INPUT TYPE="button" VALUE="Change Back Ground Color" NAME="MyField"
onClick="document.bgColor='blue' ">
<INPUT type="button" value="Change to Red!" name="redbutton"
onClick="document.bgColor='red'"> <br>
<INPUT type="button" value="Change to Yellow!" name="yellowbutton"
onClick="document.bgColor='yellow'"> <br>
<INPUT type="button" VALUE="Change to Blue!" NAME="Bluebutton"
onClick="document.bgColor='blue'"><BR>
<INPUT TYPE="button" NAME="buttonPrint" VALUE="Print"
onClick="window.print()">
<INPUT type="button" value="Go to the Right Page" name="rightbutton"
onClick="window.location="Right8-2.html">
</FORM>
</BODY>
</HTML>
left frame, which has been attached.
Can someone please help me with this code. I am new to JavaScript and
can't figure it out.
What needs to happen is this:
On the left frame you should have a series of buttons, which when pushed
makes things happen on the right frame.
1) Prompt the user to enter back ground color, text color, link colors,
title and some lines of text.
2) A button which when pushed shows text, back ground color etc. on the
RIGHT frame...not the LEFT frame.
3) A Script/Prompt box on the left frame, which when the user types in
"What is background Color", say user types in Blue and pushes
submit...it changes the background color to be blue on the RIght frame
and not the left...
What I have done so far, is create buttons to change background color
but it changes it in the LEFT frame and not the RIGHT frame...So my
question is How do I get the buttons and text information to appear on
the Right frame, but created in the left frame.
Confusing isn't it...Is there anyone out there who could help me pretty
promptly???
Thanks so much....
<HTML>
<HEAD>
<TITLE>Exercise Left8-2 - LEFT FRAME PAGE with Document Object</TITLE>
<H3>This is the left document of Exercise 8-2</H3>
<SCRIPT LANGUAGE="JavaScript"
function checkField (field) {
if (field.value == "") {
window.alert("Please enter a Back ground Color");
field.focus ();
}
}
</Script>
<BODY>
<SCRIPT LANGUAGE="JavaScript">
var username = window.prompt("Welcome to Exercise 8-2",
"Enter your name here");
window.prompt("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">
Enter a Back Ground Color:
<INPUT TYPE="text" Name="MyField" onBlur-"checkField(this)")
<INPUT TYPE="Submit">
<INPUT TYPE="button" VALUE="Change Back Ground Color" NAME="MyField"
onClick="document.bgColor='blue' ">
<INPUT type="button" value="Change to Red!" name="redbutton"
onClick="document.bgColor='red'"> <br>
<INPUT type="button" value="Change to Yellow!" name="yellowbutton"
onClick="document.bgColor='yellow'"> <br>
<INPUT type="button" VALUE="Change to Blue!" NAME="Bluebutton"
onClick="document.bgColor='blue'"><BR>
<INPUT TYPE="button" NAME="buttonPrint" VALUE="Print"
onClick="window.print()">
<INPUT type="button" value="Go to the Right Page" name="rightbutton"
onClick="window.location="Right8-2.html">
</FORM>
</BODY>
</HTML>