my form is not working as you submit for the schedule homework

I cant make this work for my Web Master I Class, My .js file code pass

Page 1 of 1

1 Replies - 1010 Views - Last Post: 07 July 2009 - 02:07 PM

#1 media9web  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 07-July 09

my form is not working as you submit for the schedule homework

Posted 07 July 2009 - 12:01 PM

I cant make this work for my Web Master I Class, My .js file code pass with no errors and my path looks good on my html file, I cant find any reason for this not to work however my form is not working as you submit for the schedule homework, please advice and tell me what is missing. I also attach the two DW files.
Thank you.



// java.js file------------->

function getinfo()
{
	var varclasses = document.homework.Classes.value
	var varweeks = document.homework.Weeks.value
	var varalert = false
	var txthomework
}
	// DFC------------->
if (varclasses == 1){	
 	if (varweeks==1){txthomework = "Design for Continuity, Week 1 Assignment is:
	Create a single-page print brochure for a local accounting business in Adobe Illustrator. Define each text area as Flash Text and convert at least two shapes in your layout to Graphic symbols. The document should be CMYK, 8 1/2 x 11 and not include photographs or other bitmaps.
	Create a new Flash document next, 800 x 600 pixels with a frame rate of 30. When you are finished with the brochure, use the Import menu in Adobe Flash to bring your Illustrator document into the new Flash document. Move and resize elements to create an online presentation from your brochure. Ensure that all text areas were imported correctly and the font, font size, and text color match the print document. Verify all colors are correct between your print and Web versions, and save your Flash movie as a .swf file. "}	
 	if (varweeks==2){txthomework = "Design for Continuity, Week 2  No Assignment:"
 		varalert = true
 		}		
 	if (varweeks==3){txthomework = "Design for Continuity, Week 3 Assignment is:
	Nested Timelines are one of the more difficult but important aspects of advanced Flash animation. Using symbols, create an artistic animation that could be used for the vector background of a energy drink Web site. Take advantage at least four levels of nested Movie Clips. Your work should include simple animation in a Movie Clip that is placed inside another symbol, which in turn is placed in another symbol, and finally placed in another symbol that sits on the main Timeline. Multiple instances of each symbol should be used, creating the effect of many small animations running at once. The animation should appear at 1024 x 768 and run at 30 frames per second."}
 	if (varweeks==4){txthomework = "Design for Continuity, Week 4 Assignment is:
	World Resorts, a client of yours, has asked you to create an animated Flash microsite for the new rides at Fun World, a series of five roller coasters. The six content areas are one for each product and an About the Park section to read more about Fun World. The client has also requested that the microsite be available as a PDF download. Using Illustrator, Photoshop, and Flash, prepare both the Flash and PDF version of the product information. The PDF should print at 150 dpi or higher, and the Flash version should not take longer than 5 seconds to first appear in the browser. The client will approve the online piece as an Illustrator or Photoshop layout before it is brought into Flash and animated."}	
 	if (varweeks==5){txthomework = "Design for Continuity, Week 5 Assignment is:
	A design firm, Studio2008, specializes in high-end furniture and has partnered with your firm to create its online portfolio. Using 10 high-quality images of furniture products from your own computer or from sources online, create an interactive photo gallery that can play, stop, and return to the beginning. Layout and text work should be done in Adobe Illustrator and brought into Flash. Photo editing, as needed, should be done in Adobe Photoshop. Each image in the gallery should be linked to a PDF created with Adobe Illustrator that includes the high-resolution version of the image, the product name, and the pricing information. The gallery should make extensive use of masks to reveal and transition photos in an interesting way. The final output should be 700 x 450 at 24 frames per second."}
}
	//WM1--------------->	
if (varclasses == 2){	
 	if (varweeks==1){txthomework = "Web Mastering I, Week 1 Assignment is:
	A prominent educational institution is holding a competition for a Web site contract. The winner of the competition will receive a substantial sum for the creation of an extensive Web site that will be used by students who are learning Javascript. Entries for the competition must be a single Web page that features several common Javascripts as well as an explanation and example of a particular component of scripting. For this submission, you will write a brief explanation of event handlers and include a script that demonstrates event handlers. The design, graphics, and even the name of the site have been left to the discretion of the entrants. Entries will be judged on design, integration of the scripts, and the presentation of the featured script."}
 	if (varweeks==2){txthomework = "Web Mastering I, Week 2 Assignment is:
	Create a drop-down menu that can be used to navigate between the different class lists. In the header document, you will find a table with an empty cell to the far right. In this cell, add a drop-down menu. You can either do this by using Dreamweaver to insert the correct form object and alter the code, or you can type in the code yourself."}
	if (varweeks==3){txthomework = "Web Mastering I, Week 3 Assignment is:
	You are the Webmaster and Web designer for a children’s zoo in your area. You realize that to gain the attention of today’s children, you need to make your Web site more interactive. One way to add to the interaction on your Web site is through use of multimedia such as sound, video, or animation. In the following exercise, you will determine which file type to use for each media and then enter the Javascript to add the media to your Web site.
	Question 1: What type of sound file would you choose to add to the amphibians Web page?
   1. Real Audio (.rm)
   2. MPEG Layer-3 (mp3)
   3. Wave (.wav)
   4. MIDI (.mid or .midi)
   5. Audio Interchange Format  (.aif or .aiff)
In this activity, you will be asked questions about a computer system. Each question is multiple choice and the answers are presented after each question.
	Question 2. What type of network has a limited amount of linked nodes and allows each work station to specify which resources are shared?
   1. peer-to-peer
   2. client server
   3. WAN
Question 3. What concept is known as a communication process that involves a user to request information or data from a computer, and then the computer returning the data to the requestor?
   1. mitigating risk
   2. encryption
   3. client/server
	Question 4. What is the name of a system attack that uses words found in a dictionary to try to crack passwords?
   1. dictionary attacks
   2. webster attacks
   3. brute force attacks
"}	
 	if (varweeks==4){txthomework = "Web Mastering I, Week 4 Assignment is:
	Match these common error messages with their corresponding explanations.
	Question 1: Which of these common error messages indicates that the credentials passed to the server do not match the credentials required to log on to the server?
   1. HTTP Error404 - Not Found
   2. HTTP Error 401 - Unauthorized
   3. HTTP Error 500 - Internal Server Error
   4. HTTP Error 501 - Not Implemented
   5. HTTP Error502 - Service Temporarily Overloaded
	Question 2: Which of these common error messages indicates the Web page is not found, or the URL that has been entered is incorrect?
   1. HTTP Error404 - Not Found
   2. HTTP Error 401 - Unauthorized
   3. HTTP Error 500 - Internal Server Error
   4. HTTP Error 501 - Not Implemented
   5. HTTP Error502 - Service Temporarily Overloaded
	Question 3: Which of these common error messages indicates the Web server does not support the functionality required to fulfill the request?
   1. HTTP Error404 - Not Found
   2. HTTP Error 401 - Unauthorized
   3. HTTP Error 500 - Internal Server Error
   4. HTTP Error 501 - Not Implemented
   5. HTTP Error502 - Service Temporarily Overloaded
"}	
 	if (varweeks==5){txthomework = "Web Mastering I, Week 5  No Assignment:"
	varalert = true
		}
}
}
	document.homework.Assignment.value = txthomework
	if(varalert==true)
	{
	alert("No Assignment this Week")
	}



// html file ---------->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Prairie School District</title>

<script language="javascript" src="Javascript/scriptpsd.js"></script>

<link href="psd.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.style1 {color: #000066}
.style3 {color: #000033}
-->
</style>

</head>

<body><center>
<div id="wrapper">
<div id="banner"><img src="PSDimags/images/psdlogo1.png" alt="PSD" /><img src="PSDimags/images/psdlogo2.png" alt="School" /><img src="PSDimags/images/psdlogo3.png" alt="District" /></div>
<div id="navigation"><img src="PSDimags/menubarfutureuse.png" /><a href="index.html"><img src="PSDimags/images/home.png" alt="home" border="0" /></a><a href="homework.html"><img src="PSDimags/images/homework.png" alt="homework" border="0" /></a><a href="whatsnew.html"><img src="PSDimags/images/whatsnew.png" alt="what's new" border="0" /></a><img src="PSDimags/menubarright.png" /></div>


<script type="text/javascript">

var d=new Date();
var weekday=new Array(7);
weekday[0]="Sunday";
weekday[1]="Monday";
weekday[2]="Tuesday";
weekday[3]="Wednesday";
weekday[4]="Thursday";
weekday[5]="Friday";
weekday[6]="Saturday";

document.write("<h3> Welcome today is " + weekday[d.getDay()]+", Assignments are Posted:</h3>");

</script>

 <br />
 
<div id="content">

<form id="homework" name="homework">

	<table align="center" border="1" cellspacing="2" cellpadding="2" bordercolor="#006600" >
	  <tr>
		  <td width="90" height="5">

			<label><b><font color="#000033">Current Courses:</b></font></label>
				<select name="Classes" id="Classes" size="1">
					  <option>Select Course</option>
					  <option value="1">Design for Continuity</option>
					  <option value="2">Web Mastering I</option>
				</select>

			<label><b><font color="#000033">Upcoming Assignments:</font></b></label>
				<select name="Weeks" id="Weeks" size="1">
					<option>Select Week</option>
					<option value="1">Week 1</option>
					<option value="2">Week 2</option>
					<option value="3">Week 3</option>
					<option value="4">Week 4</option>
					<option value="5">Week 5</option>
				</select>

			<input type="button" value="Find Assignment" onclick="getinfo()"/>

		<textarea name="Assignment" id="Assignment" cols="90" rows="5" ></textarea>
			</td>
	  </tr>
	</table>
</form>

<br />
<script type="text/javascript">
function startTime()
{
var today=new Date();
var h=today.getHours();
var m=today.getMinutes();
var s=today.getSeconds();
// add a zero in front of numbers<10
m=checkTime(m);
s=checkTime(s);
document.getElementById('txt').innerHTML=h+":"+m+":"+s;
t=setTimeout('startTime()',500);
}

function checkTime(i)
{
if (i<10)
  {
  i="0" + i;
  }
return i;
}
</script>


<body onload="startTime()">
<div id="txt">
</div>

Attached File(s)



Is This A Good Question/Topic? 0
  • +

Replies To: my form is not working as you submit for the schedule homework

#2 forest51690  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 58
  • View blog
  • Posts: 340
  • Joined: 20-March 09

Re: my form is not working as you submit for the schedule homework

Posted 07 July 2009 - 02:07 PM

You can't put strings on multiple lines. In Javascript, the end of the statement is when the line breaks, so you can't do something like this:
var string = "I thought this would be valid
but it wasn't";


You can replace the breaks in the string with either the newline character, "\n", or the HTML break tag, "<br />" depending on where the text will go. Like this:

var1 = "I'm a string that's going \n into an alert or textarea \n cheers!";
var2 = "I'll be put into regular html <br/> cheers!";
var3 = "Here's how you can break up strings that are really "+
    "long and need to be shortened in order to fit into the "+
    "text editor's viewing window, assuming it does not have word-"+
    "wrap enabled, which it shouldn't anyways. Also make sure you "+
    "always put spaces in where they are needed! <br/><b>Cheers!</b>";

This post has been edited by forest51690: 07 July 2009 - 02:09 PM

Was This Post Helpful? 1
  • +
  • -

Page 1 of 1