I’m having an issue with a javascript interaction on a site, and I can’t figure out what’s going on.
The basic gist of this site is this: One single .php page that has multiple includes contained within hidden divs. When the next or back buttons are clicked one of the divs becomes active (visible), and it contains questions with image links for answers. When one of these links is clicked a javascript function is called which is supposed to set a value in a hidden form field equal to the value that’s passed to the function from the link.
I’ve got no idea why it’s not working. I’ve done stub testing using alerts, and everything is being passed correctly. Occasionally it’ll work on one question, but never all of them. Any help would be greatly appreciated. You can find the source code here:
In case anyone else has this issue, here’s how I solved it:
I added default values to the hidden form inputs. So, instead of:
<input type='hidden' name='answer_name' value='' />I have:
<input type='hidden' name='answer_name' value='default' />