AddSectionCallback

Adds a callback that is invoked when a section is expanded or collapsed.

Parameters

Name Type Description
objname String The name of the section.
callback Function The function to be invoked when the section is expanded or collapsed.
expanded Boolean Whether to invoke the callback when the section is expanded or collapsed. If true, the callback is invoked when the user expands a section.

Return Value

Result Value
(none)  

Example

This example registers a named function to be called when a section is expanded or collapsed:

function customSectionCallback()
{
    if ( IsFieldEmpty( "Problem" ) )
    {
         ShowErrorDiv( true, "A problem entry is required" );
    }
    else
    {
         ShowErrorDiv( false );
    }
}
AddSectionCallback( "ProblemsSection", customSectionCallback, false );

Comments

Callbacks are invoked in the order in which they are added. This callback can be used to perform validation or other data verification. If you want to display a field validation error, call MakeFieldInvalid from this callback so that any required or invalid field errors are automatically processed.