Hi all,
I am very new to Javascript and I am in some need of some help. I am creating a site that has a madlib. I got the madlib code but now I want the results of the madlib to display in another frame. The user input will be in one from and the output should be in seperate frame. I have written the code for the madlib but when I hit the submit button it does not do anything. Here are my codes for the pages.
The frameset code is
[HTML]<html>
<head>
<script language="JavaS cript">
function passText(str) {
top.frames['right'].document.yourf orm.msg.value = str;
}
</script>
</head>
<frameset cols="50%,50%*" frameborder=1>
<frame name="left" src="form.html" NORESIZE SCROLLING=YES>
<frame name="right" src="madlibresu lts.html" NORESIZE SCROLLING=NO>
</frameset>
</form>
</body>
</html>
[/HTML]
The user input page code is
[HTML]<html>
<title>Form</title>
<head>
<script>
function create(form) {
var start="go";
if (start=="go") {
text = ("<HEAD><TITLE> Mark Anthony's Address from 'Julius Caesar' </TITLE> </HEAD>");
text += ("<BODY BGCOLOR = '#FFFFFF'><CENT ER><B><FONT FACE = 'Arial' SIZE = 4>");
text += ("Mark Anthony's Address from<BR> 'Julius Caesar' </FONT></B></CENTER><BR>");
text += ("Friends, Romans, " +form.input1.va lue+ " lend me your " +form.input2.va lue+ "; ");
text += ("I come to " +form.input3.va lue+ " Caesar, not to praise him. ");
text += ("The evil that men do lives after them, the good is oft interred with their " +form.input4.va lue+ "; ");
text += ("so let it be with " +form.input5.va lue+ ". " );
text += ("The noble Brutus hath told you Caesar was " +form.input6.va lue+ "; if it were so, it was a grievous fault. ");
text += ("If you have " +form.input7.va lue+ ", prepare to shed them now. ");
text += ("You all do know this " +form.input8.va lue+ ". ");
text += ("I remember the first time Caesar put it on. ");
text += ("Through this well-beloved Brutus stabbed; for Brutus, as you know, was Caesar's " +form.input9.va lue+ ": ");
text += ("this was the unkindest " +form.input10.v alue+ " of all. ");
text += ("Here is the " +form.input11.v alue+ ", under Caesar's seal. To every Roman " +form.input12.v alue+ " he gives, ");
text += ("to every several man, seventy five " +form.input13.v alue+ ". ");
text += ("Here was a/an " +form.input14.v alue+ "! When comes another?");
}
}
</SCRIPT>
</head>
<body>
<CENTER>
Fill in the form, and then press the button for your own Julius Caesar Madlib.
<FORM>
<TABLE BORDER = 0 CELLPADDING = 2>
<TR><TD>
Plural Noun:<TD><INPUT TYPE="text" NAME="input1" SIZE=20><BR>
<TR><TD>
Part of body (plural):<TD><I NPUT TYPE="text" NAME="input2" SIZE=20 ><BR>
<TR><TD>
Verb:<TD><INPUT TYPE="text" NAME="input3" SIZE=20 ><BR>
<TR><TD>
Name:<TD><INPUT TYPE="text" NAME="input4" SIZE=20 ><BR>
<TR><TD>
Name of Polictician:<TD ><INPUT TYPE="text" NAME="input5" SIZE=20 ><BR>
<TR><TD>
Adjective:<TD>< INPUT TYPE="text" NAME="input6" SIZE=20 ><BR>
<TR><TD>
Article of Clothing:<TD><I NPUT TYPE="text" NAME="input7" SIZE=20 ><BR>
<TR><TD>
Article of Clothing:<TD><I NPUT TYPE="text" NAME="input8" SIZE=20 ><BR>
<TR><TD>
Occupation:<TD> <INPUT TYPE="text" NAME="input9" SIZE=20 ><BR>
<TR><TD>
Noun:<TD><INPUT TYPE="text" NAME="input10" SIZE=20 ><BR>
<TR><TD>
Noun:<TD><INPUT TYPE="text" NAME="input11" SIZE=20 ><BR>
<TR><TD>
Noun:<TD><INPUT TYPE="text" NAME="input12" SIZE=20 ><BR>
<TR><TD>
Animal (plural):<TD><I NPUT TYPE="text" NAME="input13" SIZE=20 ><BR>
<TR><TD>
A Food:<TD><INPUT TYPE="text" NAME="input14" SIZE=20 ><BR>
</TABLE>
<INPUT TYPE="button" VALUE="Submit" target="madlibr esults">
</CENTER>
</FORM>
</CENTER>
<html>
[/HTML]
Now I want the madlib to display in the madlibresults page. I want the final story to be in hte madlibresults frame and not have the user have to scroll. Can anyone help me get this working right?
Thank you very much!
I am very new to Javascript and I am in some need of some help. I am creating a site that has a madlib. I got the madlib code but now I want the results of the madlib to display in another frame. The user input will be in one from and the output should be in seperate frame. I have written the code for the madlib but when I hit the submit button it does not do anything. Here are my codes for the pages.
The frameset code is
[HTML]<html>
<head>
<script language="JavaS cript">
function passText(str) {
top.frames['right'].document.yourf orm.msg.value = str;
}
</script>
</head>
<frameset cols="50%,50%*" frameborder=1>
<frame name="left" src="form.html" NORESIZE SCROLLING=YES>
<frame name="right" src="madlibresu lts.html" NORESIZE SCROLLING=NO>
</frameset>
</form>
</body>
</html>
[/HTML]
The user input page code is
[HTML]<html>
<title>Form</title>
<head>
<script>
function create(form) {
var start="go";
if (start=="go") {
text = ("<HEAD><TITLE> Mark Anthony's Address from 'Julius Caesar' </TITLE> </HEAD>");
text += ("<BODY BGCOLOR = '#FFFFFF'><CENT ER><B><FONT FACE = 'Arial' SIZE = 4>");
text += ("Mark Anthony's Address from<BR> 'Julius Caesar' </FONT></B></CENTER><BR>");
text += ("Friends, Romans, " +form.input1.va lue+ " lend me your " +form.input2.va lue+ "; ");
text += ("I come to " +form.input3.va lue+ " Caesar, not to praise him. ");
text += ("The evil that men do lives after them, the good is oft interred with their " +form.input4.va lue+ "; ");
text += ("so let it be with " +form.input5.va lue+ ". " );
text += ("The noble Brutus hath told you Caesar was " +form.input6.va lue+ "; if it were so, it was a grievous fault. ");
text += ("If you have " +form.input7.va lue+ ", prepare to shed them now. ");
text += ("You all do know this " +form.input8.va lue+ ". ");
text += ("I remember the first time Caesar put it on. ");
text += ("Through this well-beloved Brutus stabbed; for Brutus, as you know, was Caesar's " +form.input9.va lue+ ": ");
text += ("this was the unkindest " +form.input10.v alue+ " of all. ");
text += ("Here is the " +form.input11.v alue+ ", under Caesar's seal. To every Roman " +form.input12.v alue+ " he gives, ");
text += ("to every several man, seventy five " +form.input13.v alue+ ". ");
text += ("Here was a/an " +form.input14.v alue+ "! When comes another?");
}
}
</SCRIPT>
</head>
<body>
<CENTER>
Fill in the form, and then press the button for your own Julius Caesar Madlib.
<FORM>
<TABLE BORDER = 0 CELLPADDING = 2>
<TR><TD>
Plural Noun:<TD><INPUT TYPE="text" NAME="input1" SIZE=20><BR>
<TR><TD>
Part of body (plural):<TD><I NPUT TYPE="text" NAME="input2" SIZE=20 ><BR>
<TR><TD>
Verb:<TD><INPUT TYPE="text" NAME="input3" SIZE=20 ><BR>
<TR><TD>
Name:<TD><INPUT TYPE="text" NAME="input4" SIZE=20 ><BR>
<TR><TD>
Name of Polictician:<TD ><INPUT TYPE="text" NAME="input5" SIZE=20 ><BR>
<TR><TD>
Adjective:<TD>< INPUT TYPE="text" NAME="input6" SIZE=20 ><BR>
<TR><TD>
Article of Clothing:<TD><I NPUT TYPE="text" NAME="input7" SIZE=20 ><BR>
<TR><TD>
Article of Clothing:<TD><I NPUT TYPE="text" NAME="input8" SIZE=20 ><BR>
<TR><TD>
Occupation:<TD> <INPUT TYPE="text" NAME="input9" SIZE=20 ><BR>
<TR><TD>
Noun:<TD><INPUT TYPE="text" NAME="input10" SIZE=20 ><BR>
<TR><TD>
Noun:<TD><INPUT TYPE="text" NAME="input11" SIZE=20 ><BR>
<TR><TD>
Noun:<TD><INPUT TYPE="text" NAME="input12" SIZE=20 ><BR>
<TR><TD>
Animal (plural):<TD><I NPUT TYPE="text" NAME="input13" SIZE=20 ><BR>
<TR><TD>
A Food:<TD><INPUT TYPE="text" NAME="input14" SIZE=20 ><BR>
</TABLE>
<INPUT TYPE="button" VALUE="Submit" target="madlibr esults">
</CENTER>
</FORM>
</CENTER>
<html>
[/HTML]
Now I want the madlib to display in the madlibresults page. I want the final story to be in hte madlibresults frame and not have the user have to scroll. Can anyone help me get this working right?
Thank you very much!
Comment