Uncaught TypeError: Cannot read property 'next_page' of undefined

I'm working on a site for a client and this bit of code has always worked in the past, but suddenly is no longer working. No one has touched the core code and I'm not even sure where to look for a resolution.

We use Docebo (an LMS) and in the test we require the student to select an answer before they can click "Next Question". If they haven't selected the answer, the button is grayed out and unclickable. I believe the framework is using the YUI library for this.

I don't get the "Uncaught TypeError: Cannot read property 'next_page' of undefined " error until I select the answer. Once the error happens, the button doesn't become functional.

Chrome's console points to this bit of code...

function controlTotQuestion()
{
var info = YAHOO.util.Dom.get('answer_info');
if(tot_question == 0)
{
setTimeout(function() {
  if(YAHOO.buttonObjects.next_page)
    YAHOO.buttonObjects.next_page.set('disabled', false);
  if(YAHOO.buttonObjects.show_result)
    YAHOO.buttonObjects.show_result.set('disabled', false);
  if(info)
    info.style.display = 'none';
}, 0);

}
else
{
setTimeout(function() {
  if(YAHOO.buttonObjects.next_page)
    YAHOO.buttonObjects.next_page.set('disabled', true);
  if(YAHOO.buttonObjects.show_result)
    YAHOO.buttonObjects.show_result.set('disabled', true);
  if(info)
    info.style.display = 'block';
}, 0);
}
}

Any help would be much appreciated!

Thanks!


ANSWERS:


It's trying to read the property next_page of YAHOO.buttonObjects. Therefore YAHOO.buttonObjects is undefined. In other words, whatever YAHOO is, it no longer has an element called buttonObjects. Is YAHOO an external library? If so, check whether they've removed the buttonObjects functionality.



 MORE:


 ? Uncaught TypeError: Cannot read property 'textContent' of undefined
 ? Vue Resource - Post multiple data
 ? Vue Resource - Post multiple data
 ? Vue Resource - Post multiple data
 ? Laravel 5 database query retrieve first table data but not in other table
 ? Laravel 5 database query retrieve first table data but not in other table
 ? Laravel 5 database query retrieve first table data but not in other table
 ? query join 3 tables on laravel
 ? How to convert mysql query to laravel 5?
 ? Laravel 5 query counting and grouping