Well,
This is what I have so far (without the javascript):
<html>

<head><title>Kasey and Julia's Personality Quiz</title></head>

<body BODY BGCOLOR="#FF00CC">

<center><h1><FONT FACE="kristen itc" SIZE="12" COLOR="#000000">Find Out Your 
Personality!</FONT>
</h1>
<h2><FONT FACE="kristen itc" COLOR="#000000">Choose the answer that best 
describes you!</FONT>
</h2></center>

<p1><FONT FACE="kristen itc">
1.) If you had the weekend free would you do?<br />
  4=Do something spontanous with a few friends<br />
  3=Go camping with your other half<br />
  2=Movie night and pig out with best friend<br />
  1=Curled up on the couch with a good book/laptop<br />
<input type=text name="weekendBox" size=1><br />
<br />


2.) If you had any amount of money to spend on a vacation where would you 
go?<br />
  4=Europe backpacking with a few close friends<br />  
  3=Mountain biking in Canada with a pal<br />
  2=Shopping spree with your best friend in Tokyo<br />
  1=Escaping to the South Pacific<br />
  
<input type=text name="vacationBox" size=1><br />
<br />

3.) On a weekly basis how many times do you hang out with friends?<br />
 4=5-7<br />
 3=3-4<br />
 2=2<br />
 1=1<br />
<input type=text name="friendBox" size=1><br />
<br />

4.) What sport would you most likely engage yourself in?<br />
4=Basketball/Football/Soccer<br />
3=Baseball/Softball<br />
2=Hiking/Tennis<br />
1=Surfing/Swimming/Motorcross/Running<br />
<input type=text name="sportBox" size=1><br />
<br />

5.) When you have a relationship what do you mostly do?<br />
4=Hang out with groups of other friends<br />
3=Go on double-dates<br />
2=Hang out with partner only on weekends<br />
1=Spend  most of the time only together or on the phone<br />
<input type=text name="relationshipBox" size=1><br />
<br />

6.) If you were stranded on an island who would you bring?<br />
4-your other half and friends<br />
3- A group of your closest friends<br />
2-your other half<br />
1-your pet<br />
<input type=text name="islandBox" size=1><br />
<br />

7.) If you were asked to do a talent show what would you do?<br />
4-An improvisation with some friends<br />
3-An act from a scripted play with some friends<br />
2-A karaoke duo<br />
1-Read a poem aloud<br />
<input type=text name="talentBox" size=1><br />
<br />

8.) When you go to school what do you look forward to doing?<br />
4-Hanging out with friends between breaks<br />
3-Being on the cell phone between breaks<br />
2-Sitting next to a friend in class<br />
1-having some quiet time in the library/lunch room<br />
<input type=text name="schoolBox" size=1><br />
<br />
<input type=button value="Calculate My Score!"</input>

</font>
</body>
</html>

What the plan is, is that if their score is 26-32 then they have a certain 
personality, if their score is 20-25 then it's another, if it is 14-19 it's 
another and if it is 8-13 then it's another. So how to I get an alert to pop up 
with their score and the personality description for that particular score? If 
it is too much to explain I totally understand, but I just thought I would see 
if I could get a little bit of help. Oh ya, since each of my text boxes has a 
different name is that what I would put in place of answer 1, 2, etc in your 
code below?

> alert(document.getElementById('answer1').value +
> document.getElementById('answer2').value +
> document.getElementById('answer3').value +
> document.getElementById('answer4').value);

Thank you so much for your response I really appreciate it. I am so bad at this 
stuff and just can't seem to figure it out.
> On Tue, Apr 15, 2008 at 12:04 PM, Kasey Clark <[EMAIL PROTECTED]> 
> wrote:
> > Ok, so I am really bad at javascript, but I have to use it for a 
> project for my computer class. This is my project: I am creating a 
> personality quiz webpage. Each question has 4 different choices (each 
> choice matches a different personality trait). I have done the HTML 
> part and have all the text boxes where the user will put a number 
> between 1 and 4 and the calculate button. Now I have to do the 
> javascript part. I need javascript to add up the total of the 8 
> boxes(there are 8 questions) and have an alert pop up with their score 
> and their personality description. So if their score is between 30 and 
> 36 they have an outgoing personality, etc. Can anyone give me any 
> advice on how to calculate the total score? Thanks!
> 
> alert(document.getElementById('answer1').value +
> document.getElementById('answer2').value +
> document.getElementById('answer3').value +
> document.getElementById('answer4').value);
> 
> this makes a couple of assumptions :)
> 
> one assumption is that the form fields have an ID attribute each.  if
> they don't, you can reference them via
> document.formname.fieldname.value
> 
> the other assumption is that all of the values are actually numeric.
> there's a few ways to handle that... but let's see how far this gets
> you first.
> 
> -- 
> Evelyn the dog, having undergone further modification pondered the
> significance of short-person behaviour in pedal depressed,
> pan-chromatic resonance, and other highly ambient domains. "Arf," she
> said.


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;192386516;25150098;k

Archive: 
http://www.houseoffusion.com/groups/Javascript/message.cfm/messageid:5180
Subscription: http://www.houseoffusion.com/groups/Javascript/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.33

Reply via email to