Share via


htmRenderFillOutForm Routine

The function htmRenderFillOutForm prepares the HTML that will render the specified form. The form is constructed based on the fields definitions dictionary, a form values dictionary, and a form error messages dictionary. The form errors dictionary allows the form to redisplayed upon validation failure, with error messages displayed next to the fields found to have data that is not valid.

Rather than passing the form definition SimpleList object, the form definition dictionary key is passed and the form definition SimpleList object is retrieved directly from the intrinsic Application object.

Form field values are passed in the Dictionary object specified by the dictFldVals parameter. These might be values actually posted using the form, or they might be default values. In any event, if a value is present for a particular form field, it is provided as a default. You can pass Nothing for this parameter to display a completely blank form.

Form field error messages are passed in the Dictionary object specified by the dictFldErrs parameter. This dictionary is typically built using the routine GetFieldsErrorDictionary and one of the routines with names of the form ValidateSubmittedItem routines. An error message will be present for a particular field when there is an error associated with that field. If an error message is present, it is added to the produced HTML such that it will appear directly below the form field to which it corresponds.

The following code shows how the HTML for rendering a form is constructed and appended to HTML that has already been constructed:

htmContent = htmContent & htmRenderFillOutForm(urlAction, _
                                               "ShipToAddress", _
                                               dictFldVals, _
                                               dictFldErrs)

Copyright © 2005 Microsoft Corporation.
All rights reserved.