0

I'm building a multi-question survey where I'm using javascript to:

  1. make sure all survey questions displayed on a page are answered

  2. show an additional question on a page based on the answer to a previous item.

Both 1 and 2 seem to be working in 90% of the browsers and operating systems I've tested this with. I'm not seeing any consistency when it doesn't work.

Example: https://ssl.bullysurvey.com/QUESTIONS/m_survey/02.html

If the 'Yes' response is selected for item 1a, you'll see 1b appear. Both items should then require a response before proceeding to the next page. When 'Yes' for 1a is selected the file '02_table_2.html' is loaded and inserted below 1a.

The problem is that about 10% of the time when 'Yes' is selected for 1a, 1b doesn't always appear or if it does, a response is not required for 1b. When I collect a 'Yes' response for 1a in my database, I should always have a response for 1b. This is not always the case and it's a problem. In these rare cases, I don't think the javascript code is working all the time. Maybe when the problem appears the pages have not loaded completely or there's some other glitch I'm not aware of.

I'd appreciate it if someone could look this over. Do you see a problem with my coding? Is there a better way to do this?

Thanks so much,

Mike

Mike E
  • 31
  • 1
  • 7

1 Answers1

0

You code is quite sloppy. For example you are loading both jQuery 1.5 and jQuery 1.3

In addition there are MANY libraries and custom scripts -- it is quite confusing.

Take out the duplicate conflicting library as a first step and then try an organize your code, I'm sure you will be able to find the bugs then.

Hogan
  • 69,564
  • 10
  • 76
  • 117
  • This is helpful. I'll dig in a remove references to jQuery 1.3. Since I'm not a javascript programmer, I'm not sure how to organize the code better. – Mike E Nov 25 '11 at 16:23
  • Well, here is a hint -- with what you have given us all we can do is view source -- look at those results yourself... are they readable? – Hogan Nov 25 '11 at 19:10