Hi there,
I'm making a web form to record the number of people who answer a particular question correctly. E.g.
The [ ] represents a field to be filled in by the user. The left field is the number who answered correctly and the right field is the total number of people questioned. Therefore the number in the right box must be greater than or equal to the number in the left.
This form exists already and we get people putting a higher number in the right box, making the results of the survey meaningless, because it is impossible for 5 out of 4 people to answer a question correcty for example.
I don't know much javascript, so I was wondering if anyone could help write something that alerts the user if they enter a higher number in the right box than the left?
If it will work with the following example which has three questions, that would be great! (This would help me see how to deal with multiple questions).
Many thanks,
Katie
I'm making a web form to record the number of people who answer a particular question correctly. E.g.
Code:
Question: How many people answered question 1 correctly?
Answer: [ ] of [ ]
The [ ] represents a field to be filled in by the user. The left field is the number who answered correctly and the right field is the total number of people questioned. Therefore the number in the right box must be greater than or equal to the number in the left.
This form exists already and we get people putting a higher number in the right box, making the results of the survey meaningless, because it is impossible for 5 out of 4 people to answer a question correcty for example.
I don't know much javascript, so I was wondering if anyone could help write something that alerts the user if they enter a higher number in the right box than the left?
If it will work with the following example which has three questions, that would be great! (This would help me see how to deal with multiple questions).
Code:
Question: How many people answered question 1 correctly?
Answer: [ ] of [ ]
Question: How many people answered question 2 correctly?
Answer: [ ] of [ ]
Question: How many people answered question 2 correctly?
Answer: [ ] of [ ]
Many thanks,
Katie