The mgiFieldContent Tag

Tag Behavior

The mgiFieldContent tag displays the value of a field from a form submission, all post arguments, or all post argument values. (See also mgiPostArgument)


Tag Syntax

The mgiFieldContent tag has one required parameter and four optional parameters. The tag form is:

<mgiFieldContent name="Field Name" defaultValue="Value"
encodeHTML="Yes/No" function="Tag Function" delimiter="Separator">

Required Parameters:

  • name="Field Name" where "Field Name" is the exact name of the form field whose value you wish to display. If two post arguments have the same name (e.g., checkboxes and multiple select pop-up menus), a comma delimited list of all post arguemnt values for that name is displayed.

Optional Parameters:

  • defaultValue="Value" where "Value" is the text that will display if the form field is blank. By default the value of the form field is displayed.
  • encodeHTML="Yes/No" where "Yes" indicates that the value of the form field is HTML encoded (e.g., the less than character "<" is encoded as "&lt;") and where "No" indicates that form field values are not encoded (i.e., all characters are written as text). The default is "Yes".
  • function="Tag Function" where "Tag Function" is the action of the tag. The "returnAllNames" function returns a delimited list of all post argument names. The "returnAllValues" function returns a delimited list of all post argument values. The default delimiter for the "returnAllNames" and "returnAllValues" functions is a comma. The name and value delimiter may be customized by including the delimiter parameter. The default function of the mgiFieldContent tag is to display the value of the form field listed in the name parameter.
  • delimiter="Separator" where "Separator" is the character that separates each name in the "returnAllNames" function and each value in the "returnAllValues" function. The default delimiter is a comma.


Example Usage and Output

<mgiFieldContent name="Phone Number">

In this example, a field named "Phone Number" is included on a form. When a web site visitor completes the form, they enter "919-555-0375" in the "Phone Number" field. Then the visitor submits the form to a page containing the mgiFieldContent tag. The following is displayed in the location of the mgiFieldContent tag:

919-555-0375

<mgiFieldContent name="Email" defaultValue="webmaster@domain.com">

In this example, a field named "Email" is included on a form, but the web site visitor is not required to list their email address. Therefore, in order to use the email address in an mgiSendMail tag (for example), a default email address is included. If the visitor enters an email address, that email address will be displayed. If the visitor does not enter an email address, the default address is displayed:

webmaster@domain.com


Suggested Usage

  • Form Processing
  • Guestbook
  • Embedded Information
  • File Modifications (Write, Append)


[Return to the Referencing MGI Menu]


[User Guide Main Menu] [Understanding MGI Menu] [Using MGI Menu] [Referencing MGI Menu]