If a page has a component, the validation error messages may display a 
second time. In web2py_ajax.html the function web2py_ajax_init() gets 
called twice, first when the main page loads called by 
*jQuery(document).ready(function() 
{});* and second when the component loads, called by function *
web2py_ajax_page()*. If the component loads quickly, the second display may 
not be visible. I am working with a component that has a minor delay as it 
loads data and the validation errors on the main page form display, then 
hide and display again.

I made this change to function web2py_ajax_init()
was:  
  jQuery('.error').hide().slideDown('slow');
now: 
      jQuery('.error').each( function () 
{                                                                               
            

        if (! jQuery(this).data('_error_shown')) 
{                              
          jQuery(this).hide().slideDown('slow').data('_error_shown', 
1);        
        
}                                                                       
      });                                  

Each error message displays only once now.

Reply via email to