Adds a callback that is invoked before the page is submitted.


Name Type Description
callback Function The function to be invoked before the page is submitted.

Return Value

Result Value
true Continue processing other submit callbacks. If a function does not return a value, it is assumed to be "true".
false Stop processing other submit callbacks and cancel the submit operation.


This example registers a named function to be called before the page is submitted:

function customSubmitCallback()
    // Prevent submit if Description field is empty
    if ( IsFieldEmpty( "Description" ) )
         ShowErrorDiv( true, "A description is required" );
         return false;
         ShowErrorDiv( false );
         return true;

AddSubmitCallback( customSubmitCallback );


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 and return "true" from this callback so that any required or invalid field errors are automatically processed.