webformitemerror(
ITEM
)

The webformitemerror( function returns the error for a specific web form item, if any (used when processing a web query with Panorama Server).


Parameters

This function has one parameter:

item – name of the form item, which must match a post argument in the submitted HTTP POST query.


Description

This function returns the error for a specific web form item, if any. It can be used in a Text Display Object to display an error message associated with a field in a form. For example, suppose you have a web form that allows input of a credit card, with code like this to process the data entry and add the information to the database.

grabwebformitems ""
webformitemcheck "webName",
    "Please enter a valid name.",
    wordcount(import())<2 or rangenotmatch(import(),"AZaz  ")
webformitemcheck "webCard",
    "Please enter a valid credit card number.",
    cardvalidate(import())=false()
webformitemcheck "webCardYear",
    "Your credit card is expired or has an invalid expiration date.",
    cardexpirevalidate(webCardMonth,import())=false()
if webformerrors("")<>""
    retrywebform
    rtn
endif
addrecord
stashwebformitems

If there is a problem with the credit card, the original data entry form will be redisplayed on the users' browser. But how will the user know what the problem is? The solution is to place a Text Display Object on the form next to the data entry field (assuming you are using Panorama to generate the web form), and use this formula in the object:

webformitem("webCard")

When the form is re-displayed, the user will see the message Please enter a valid credit card number next to the card number field.


See Also


History

VersionStatusNotes
10.2No ChangeCarried over from Panorama 6.0.