webformerrors(
FORMAT
)

The webformerrors( function returns a list of errors that have been collected with the WebFormItemCheck statement.


Parameters

This function has one parameter:

format – format of the list that is returned. If this parameter is "", then a carriage return delimited list will be returned. If the parameter is "<ul>" or "<ol>" then an unordered or numbered HTML list will be returned. If the parameter is "<table>" then an HTML table will be returned. You may place options in the table tag, for example "<table border=1 cellpadding=3>".


Description

This function returns a list of errors that have been collected with the WebFormItemCheck statement. The parameter controls the format of the list that is returned. If this parameter is "", then a carriage return delimited list will be returned. If the parameter is "<ul>" or "<ol>" then an unordered or numbered HTML list will be returned. If the parameter is "<table>" then an HTML table will be returned. You may place options in the table tag, for example "<table border=1 cellpadding=3>".

For even more control you can specify separate header=, footer=, prefix= and suffix= tags. The prefix and suffix will be added to each individual error message. The header and footer tags will be added at the top and bottom of the entire list. Here’s an example for creating a custom html table:

webformerrors(|||header="<table border=0>" footer="</table>"
    prefix="<tr><td><font face="Verdana" size=-1>"
    suffix="</font></td></tr>"|||)

Here is a complete example that shows how this function can be used with the webformitemcheck statement to check for and report data entry errors in a web form.

webformitemcheck "Name",
    "Please enter a valid name.",
    wordcount(import())<2 or rangenotmatch(import(),"AZaz  ")
webformitemcheck "Card",
    "Please enter a valid credit card number.",
    cardvalidate(import())=false()
webformitemcheck "CardYear",
    "Your credit card is expired or has an invalid expiration date.",
    cardexpirevalidate(webformitemvalue("CardMonth"),import())=false()
cgiHTML=webformerrors("<ul>")
if cgiHTML<>"" rtn endif
...
... continue with data entry procedure
...

See Also


History

VersionStatusNotes
10.2No ChangeCarried over from Panorama 6.0.