Click or drag to resize

validateForm Method

Check that all required form fields are completed in the loaded document.

Syntax
JavaScript
function validateForm(showMessages);

Parameters

showMessages

Type: Boolean

A value indicating whether a message should be shown if validation fails (e.g. all required form fields are not completed).

Return Value

Type: Boolean

Returns true if validation was successful (e.g. all required form fields are completed).

Returns false if validation failed (e.g. all required form fields not are completed).

Remarks

This method will show a warning (e.g. "One or more required fields were not filled out.\n\nRequired fields are highlighted in red.") and return false if all required form fields are not completed and showMessages is true; otherwise the method will simply return false.

Examples
JavaScript
var myApi = new PdfWebControlApi("PdfWebControl1"); // where "PdfWebControl1" is the ID (ClientID) assigned to the PdfWebControl instance
//if form is completed
if(myApi.validateForm(true))
{
    //do complete page postback
    __doPostback("PdfWebControl1", "");
}
See Also