Windows 7 Forums

Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.

Windows 7: Help With my HTML Project ;)

18 Oct 2009   #1

7 x64/ Back-Track 4
Help With my HTML Project ;)

Im just learning basic HTML, and this is my first year - and i need some help with my project!! Here is my code so-far: But I left space in between the <script language=JavaScript> and the </script> tags for my variables. Thats really all i dont kno how to do :P


<!--MADE BY ME! XXXXXXXXXXXXXXXXXXXXXXXXx...........................................-->

<title>Biology Quiz!</title>
<script language=JavaScript>


<body onLoad="alert('Instructions: You Pick a Choice for Your Answer. After You Are Done, Hit the Grade Now! Button, To Restart Simply Hit The Reset Button, There are also Instructions On The Webpage, To View Those, Simply Hit The Button Labled Instructions. Scroll Down Beneath the Picture to View the Quiz Questions And Also Buttons To Help You On Your Way! Good Luck!')">

<h1> The Bio Quiz Page</h1></center>
<hr width=175>
<input type="button" value=Instructions onClick="alert('Instructions: You Pick a Choice for Your Answer. After You Are Done, Hit the Grade Now! Button, To Restart Simply Hit The Reset Button, There are also Instructions On The Webpage, To View Those, Simply Hit The Button Labled Instructions. Scroll Down Beneath the Picture to View the Quiz Questions And Also Buttons To Help You On Your Way! Good Luck!')">

<input type="button" onClick="parent.location='#Start'" value="Go to Survey Start"></center>

<center><table border=7 bordercolor=black><td><img src="quiz.jpg"></td></center><tr><td>

<a name="Start"><center><h1> Are you Ready?</h1></center>

<td><h1> 1. What are Proteins made up of?</h1></td><tr>
<input type=radio name=one value="A"> A. Hydrogen and Oxygen<br>
<input type=radio name=one value="B"> B. Hydrogen and Nitrogen<br>
<input type=radio name=one value="C"> C. Hydrogen, Oxygen, and Carbon<br>
<input type=radio name=one value="D"> D. Hydrogen, Oxygen, Nitrogen, and Carbon<br>
<input type=textarea name=Q1 size=70>

<td><h1> 2. What are Fats/Lipids made up of?</h1></td><tr>
<input type=radio name=two value="A"> A. Carbon<br>
<input type=radio name=two value="B"> B. Hydrogen<br>
<input type=radio name=two value="C"> C. Oxygen<br>
<input type=radio name=two value="D"> D. All of the Above!<br>
<input type=textarea name=Q2 size=70>

<td><h1> 3. What are Carbohydrates made up of?</h1></td><tr>
<input type=radio name=three value="A"> A. Carbon<br>
<input type=radio name=three value="B"> B. Oxygen<br>
<input type=radio name=three value="C"> C. Carbon and Oxygen<br>
<input type=radio name=three value="D"> D. Carbon and Nitrogen <br>
<input type=textarea name=Q3 size=70>

<td><h1> 4. What are the Four Basic Elements of Life?</h1></td><tr>
<input type=radio name=four value="A"> A. Carbon, Nitrogen, and Hydrogen<br>
<input type=radio name=four value="B"> B. Nitrogen and Carbon<br>
<input type=radio name=four value="C"> C. Oxygen and Hydrogen<br>
<input type=radio name=four value="D"> D. Carbon, Hydrogen, Oxygen, Nitrogen<br>
<input type=textarea name=Q4 size=70>

<td><h1> 5. What is the Chemical Formula for the Carboxyl Group?</h1></td><tr>
<input type=radio name=five value="A"> A. NH2<br>
<input type=radio name=five value="B"> B. COOH<br>
<input type=radio name=five value="C"> C. H2O<br>
<input type=radio name=five value="D"> D. CHON<br>
<input type=textarea name=Q5 size=70>

<td><h1> 6. What is the type of Bond Water forms with other Water Molecules?</h1><td><tr>
<input type=radio name=six value="A"> A. Ionic Bond<br>
<input type=radio name=six value="B"> B. Hydrogen Bond<br>
<input type=radio name=six value="C"> C. Metallic Bond<br>
<input type=radio name=six value="D"> D. H2O Bond<br>
<input type=textarea name=Q6 size=70>

<td><h1> 7. What are Proteins used for in the Human Body?</h1></td><tr>
<input type=radio name=seven value="A"> A. Store Energy<br>
<input type=radio name=seven value="B"> B. No Use<br>
<input type=radio name=seven value="C"> C. Make us Smarter<br>
<input type=radio name=seven value="D"> D.Help us Digest<br>
<input type=textarea name=Q7 size=70>
<center><td><h1> Total Score:</h1>
<input type=textarea name=Ans rows=6>

But what i need help with is the variable part... I kno that they go withen the <script language=JavaScript> and </script> tags, but how do i make the variables store all of that info. and make it do those certain things..

The textboxes underneath each question are to display either - Yes, this is correct, or No, this is not correct. The Text box at the bottom of the page, underneath Total Score, will show the score out of X number of points, and etc. etc. And also, the "test" will only be graded once a "Grade Now" button has been clicked, which i will make once i figure out the variables. So, any help with the variables?

Notex2: This was programmed to work in IE8, which is what my school uses, so, when i opened it in my own laptop at home(im on it now) it's format was different as viewed in my Google Chrome Browser.

Thanks ^^
My System SpecsSystem Spec
18 Oct 2009   #2

Windows 7

first of all, this has to be changed:
<center><td><h1> Total Score:</h1>
<input type=textarea name=Ans rows=6>
the <center> tag is deprecated. I strongly recommend you to use the CSS styling method to avoid compatibility issue later on. It is also a good practise to do so.

Change it to this:
<td width="100%"><h1 style="text-align:center;"> Total Score:</h1>
<input type=textarea name=Ans rows=6>
There is a lot of issues with the tag placements and stuff, I won't go into it too much. You shouldn't use too much tables as your outline. Maybe later I can help you re-organize the code.

As to your question

I need to know what you need to do. Because "do certain things" is not really descriptive enough.
In order to store variables you can declare the variable using the term var


var numbers = 1;
that basically tells the browser that the variable "numbers" is 1

you can also do this:

var string = "Hello World"
That will store "Hello world" in the variable "string", so you can use them later on.

Disclaimer: I'm also a javascript n00b


After furthur examining your code, I found a lot of errors. Little things like <br> and <br />, not having "" while declaring names etc.

I strongly recommend you to finish the HTML Tutorial at w3schools before attempting to code this page. You may need a complete re-write of the code.

Futhur more, I strongly recommend you to finish the CSS Tutorial at w3schools so you can make your page look prettier.

This is an example project made by me, modify as you wish

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
h1 {
	text-align: center;
<script type="text/javascript">
//Written as a test project by ultimatebuster
//KKSNetwork -
function checkAns(){
	var rightAnswer = document.getElementById("right"); //Get the element with the id of "right"
	var wrongAnswer = document.getElementById("wrong"); //Get the element with the id of "wrong"
	if (rightAnswer.checked==false && wrongAnswer.checked==false) { // check if nothing is selected
		alert ("You haven't selected anything yet!");
	} else {
	if (rightAnswer.checked==true) { // Basically saying if the Right Answer radio box is check, then
	alert ("You win!"); //calls msgbox
	} else { // or else
	alert ("You lose!"); //calls msgbox



<h2>Choose one:</h2>
<form name="form1">
    <input type="radio" name="radio" id="right" value="right" />Right Answer
    <br />
    <input type="radio" name="radio" id="wrong" value="wrong" />Wrong Answer
    <input type="submit" name="button" id="button" value="Submit" onclick="checkAns()" />
you can find the same thing at
My System SpecsSystem Spec
19 Oct 2009   #3

7 x64/ Back-Track 4

Mmmm... valid points. But i mean- you can take it up with my teacher We were told that a <br> tag, the line break tags didn't even need quotes and as well as they didn't even need a </br> tag But thanks for the tips - as for using CSS style sheet, i decided not to due to the small space of time i was given for my project
My System SpecsSystem Spec

19 Oct 2009   #4

Windows 7

What? Your teacher told you to use <br>????? No offense, but that's really kinda n00b-ish.

In HTML, especially the future version, it's best (will become required) for you to close every single HTML tags you open.

So you would open an html tag like <p> and close it with </p>

In the case of <br>, or line break, there won't be any information stored within the tag <br>. You can technically close the <br> tag by typing </br> afterwards, but that's just wasting space, therefore, we use something like this <br />
That slash at the end will basically close the tag.

You can also apply that to images
<img src="file.png" alt="My Picture" />

I have a general purpose style sheet somewhere on my HDD, but I can't find it right now. This general purpose style sheet (badly made, sorry. It took me 30 minutes) can be found modified at My IP Maybe you can snatch it off there?
My System SpecsSystem Spec

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Similar help and support threads
Thread Forum
Transparency Project
(Due to real-life issues, I will no longer continue development on any of these programs. Sorry. But if anyone wants to continue development, the source code is linked below.) System Transparency All files can be downloaded from here -...
Free Developer Programs and Projects
New Gaming Project
Hi Guys, I'm soon (hopefully) going to be getting a decent paid job and am hoping to do one final PC build before puting money together to save for a house of my own lol. i have been browsing the web for a few days and have come up with the following spec. im aiming to spend no more than 2000,...
My computer project
Hi guys Depending if I get this new job I will be doing a project with my computer case, I will have the same specs, I just would like to add the following. (My case is a Shinobi windowless) - NZXT HUE RGB controller/LED install - Bluray disc drive - Side to be cut out (am trying to...
PC Custom Builds and Overclocking
My newest project
I'm gonna open up this thing and turn it into a clock. Any suggestions?
Chillout Room
help with project
I have to do a project for my computer literacy class, and it requires Windows XP. All that I have access to is Windows 7. Is there any way to get an interactive XP interface on my Windows 7 laptop?
General Discussion
Project Idea's
Yes I know this is a little odd to see on the windows 7 forums but I could use some help or some idea's on this project I have on Thursday in College, I have to do a 10-20 minute presentation in front of the class, and the subject I had chosen was the "Latest tech toys or Gadgets" And I had...
Chillout Room

Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 02:11.

Twitter Facebook Google+

Windows 7 Forums

Seven Forums Android App Seven Forums IOS App