Recommended Posts

Just now, Thunderfist said:

I just of rid of the error! All I did was change the value of i in for (i = 0; i <NUM_QUESTIONS; ++i) from 0 to 1.

That works if your questions are named "q1" through "q11", but then you should change the condition to <= otherwise you will only sum "q1" through "q10"

Share this post


Link to post
Share on other sites
2 minutes ago, Jinz said:

That works if your questions are named "q1" through "q11", but then you should change the condition to <= otherwise you will only sum "q1" through "q10"

They are 'q1' through to 'q11'. I still need to get it to send people to a different page when the submit button is pressed.

--EDIT--

I just realized that I probably should do that.

--EDIT--

Just fixed it so it did sum up all 11.

Share this post


Link to post
Share on other sites
4 minutes ago, Thunderfist said:

They are 'q1' through to 'q11'. I still need to get it to send people to a different page when the submit button is pressed

Then should set NUM_QUESTIONS to 11 and change < to <=

My last example shows how to send to different pages, the one with index.html, resul1.html, and result2.html. It shows how to use if/else to determine which page to send to. Do like that after the for loop that computes the sum.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Recently Browsing   0 members

    No registered users viewing this page.