Advertisement

08.31.2005 at 02:28PM PDT, ID: 21546966
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.6

Survey with Javascript and HTML

Asked by Testsubbu in Web Languages/Standards, Macromedia Homesite

Tags:

Hello experts,

I am trying to create a simple questionnaire using frontpage with a total of 16 questions using Javascript and HTML. The questions are big and so they will be distributed in 4 pages. The first page will have 3 questions, the 2nd will have 5 questions, the 3rd will have 5 questions and the 4th page 4 questions. Each question will have a TRUE or FALSE answer, using radio buttons. I have already inserted the form, typed in the questions and layed out the radio buttons.
At the end of the questionnaire there will be a "Submit button", which should validate that all questions have been answered, if not, an Alert message should pop up. Since the questions are True or False, each questions will have a right answer, and at the end when the user presses the submit button, the function should be able to add up all the right answers and if the number of right answers are GREATER THAN 12, then a message should pop up saying "CONGRATULATIONS". If the number of right answers are LESS THAN 12, then a pop up should come up ALERTING THE QUESTIONS THAT NEED TO BE WORKED ON (indicating the chapters to be worked on)

I already started out coding in Javascript with just 3 questions, and this is what I have so far. I haven't taken any formal classes in javascript & html, so am just using some knowledge from books. Any help on this would be greatly appreciated.

<title>Page 1 of 4</title>
</head>
<body>
<form name="testpage1">
  <p>Question 1: 1<input type="radio" name="R1" onClick="choice1=1">0<input
  type="radio" name="R1" onClick="choice1=0" ></p>
  <p>Question 2: 1<input type="radio" name="R2" onClick="choice2=1">0<input
  type="radio" name="R2" onClick="choice2=0" ></p>
  <p>Question 3: 1<input type="radio" name="R3" onClick="choice3=1">0<input
  type="radio" name="R3" onClick="choice3=0" ></p>
  <p><input language="javascript" type="button" value="Submit" name="sub"
  onClick="validate(this.form)"></p>
</form>
</body>
<script language="Javascript1.1">
var final=0
var choice1=0
var choice2=0
var choice3=0

function validate(frm)
{
   var c=0;
   
   for(var i=0;i<frm.elements.length;i++)
   {
     if(frm.elements[i].type == "radio" && frm.elements[i].checked)
     {
     c++;
     }
   }  
   if(c < 3)
   {
     alert(" Please answer all of the questions/n");
   }
   else
   {
      final = choice1 + choice2 + choice3;
      alert (final);
   }      
}
Start Free Trial
[+][-]08.31.2005 at 10:36PM PDT, ID: 14799645

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.01.2005 at 08:17AM PDT, ID: 14802834

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.01.2005 at 02:27PM PDT, ID: 14806075

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Web Languages/Standards, Macromedia Homesite
Tags: javascript
Sign Up Now!
Solution Provided By: amit_g
Participating Experts: 2
Solution Grade: A
 
 
[+][-]09.02.2005 at 07:40AM PDT, ID: 14810517

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.02.2005 at 12:25PM PDT, ID: 14812867

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.05.2005 at 09:07AM PDT, ID: 15023158

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.05.2005 at 12:11PM PDT, ID: 15024723

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32