< Day Day Up > |
The <xsf:errorCondition> ElementWhen you add validation rules using the InfoPath 2003 client in design mode, then a corresponding number of xsf:errorCondition elements are added to the manifest file. The xsf:errorCondition element defines a potential error condition on a specific node in the DOM tree. The attributes of the xsf:errorCondition element are as follows :
The xsf:errorCondition element has a required child element, the xsf:errorMessage element, which is described in the next section. The <xsf:errorMessage> ElementThe xsf:errorMessage element specifies the message that is to be displayed if the DOM node specified in the match attribute of its parent xsf:errorCondition element is considered to be invalid. The message is the text contained between the start and end tags of the xsf:errorMessage element. In addition, the xsf:errorMessage element has a required shortMessage attribute whose value specifies a short message to be displayed in the event of the DOM node being considered invalid. There is also an optional type attribute that specifies the type of error message to return. The permitted values are modal and modeless . A modal message would typically be presented in a dialog box that the user must respond to before proceeding. The following code illustrates a possible structure of elements inside an xsf:customValidation element: <xsf:customValidation> <xsf:errorCondition match="my:expenseReport" expressionContext="my:reportDate" expression="msxsl:string-compare(., ../my:startDate) < 0 and ../my:startDate != ''" showErrorOn="."> <xsf:errorMessage type="modeless" shortMessage="The report date occurs before the end of the expense period."> The report date occurs before the end of the expense period. This is not permitted. </xsf:errorMessage> </xsf:errorCondition> </xsf:customValidation> |
< Day Day Up > |