Share via


Default Element

Contains the default value of a field to which new item forms are initialized. This element has two uses:

  • In a Switch statement, it is run if none of the Case elements return TRUE.
  • Within the Field element, it sets the default value for a field.

Syntax

<Default
  ExpandXML = "TRUE" | "FALSE">
</Default>

Attributes

Name Description
ExpandXML TRUE if the rendered content is passed again through the CAML interpreter, which allows CAML to render CAML.
Parent Elements Child Elements
DocIcons, Field, MetaData, Switch Column, Column2, Field, FieldFilterImageURL, FieldSortImageURL, FieldSortParams, FilterLink, Forms, GetEmailFromUser, GetFileExtension, GetVar, HTML, HttpHost, HttpPath, HttpVDir, List, ListProperty, LookupColumn, Mapping, PageUrl, Property, SetVar, Switch, URL, UserID, View

Example

The following example provides descriptive text and sets the default value of the FavColor field to black.

<Field Type="Text" Name="FavColor">
  <Description>Enter your favorite color here. If you dont have a favorite color, enter "Black".
  </Description>
  <Default>Black</Default>
</Field>

See Also

Universal Attributes for Page Rendering Elements