Help needed with Frames and Buttons in JavaScript

T

TrvlOrm

Can anyone help solve this problem for me please?

What is supposed to happen is I have created 2 frams, left and right.

On the left frame a series of button which when clicked prompt the
user to enter information for background color, text color, link
colors, title and some lines of text to show up in the Right frame. It
also needs to have a Right Frame button, which when clicked shows the
user the background color in the right frame..not the left frame.

I have already created some background buttons on the left frame, but
it is supposed to change the color in the right frame...so how do I
get this to work?

Also a prompt or script box needs to be added, when the page loads a
message pops up and asks "What is the background color" the user types
in Blue or what ever color and pushes the submit button (In the left
frame). But the color needs to changed in the Right Frame.

Any one have any ideas??? Thanks so much. I'm new to JavaScript and
have been trying to get this to work for days now..but not clear on
what I'm doing wrong or what I'm missing out....

Also one other thing; Anyone know of free javascript editos which I
can download off the net? I need something to tell me Exactly what I'm
doing wrong or what I am missing off my code.
Thanks again....

<HTML>
<HEAD>

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top