webformitembang(
webformitembang(
ITEM
)

The webformitembang( function returns an exclamation point, icon or symbol to indicate an error in a web form for data entry.

Parameters

This function has one parameter:

item – the field name that may contain an error.

Description

This function returns an error symbol for a specific web form item, if any. The function is designed to be used in a Text Display Object on a form. It should be placed next to a field item. If that item has an error, the Text Display Object will display an exclamation mark. You can change this to some other symbol (or to a URL for an image) by using the webformitembang statement.

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:

    webformitembang("webCard")

When the form is re-displayed, the user will see the error symbol next to the card number field. (Remember, the default symbol is the exclamation point, but you can change the symbol with the webformitembang statement.)

If you would also like to display the actual error message elsewhere on the form, use the webformitemerror( and or webformerrors functions.

See Also

- deletewebtemplate -- deletes the web template (a dictionary) associated with a form (if any).
- getwebtemplate -- retrieves the web template (a dictionary) associated with a form (if any).
- getwebtemplate( -- retrieves the web template (a dictionary) associated with a form (if any).
- getwebtemplatetext -- retrieves the text of the web template (a dictionary) associated with a form (if any).
- getwebtemplatetext( -- retrieves the text of the web template (a dictionary) associated with a form (if any).
- grabwebformitems -- grabs multiple web form items and stuffs the values into fields and/or variables.
- listwebtemplates -- retrieves a list of web templates in the specified database, if any.
- listwebtemplates( -- retrieves a list of web templates in the specified database, if any.
- makeformwebtemplate -- converts a Panorama form into the equivalent HTML/CSS.
- renderwebform -- renders a Panorama web form into HTML, merging data into the template as necessary.
- renderwebform( -- renders a Panorama web form into HTML, merging data into the template as necessary.
- retrywebform -- retries a web form that has missing or invalid data.
- savewebtemplate -- saves a web template (a dictionary) associated with a form.
- sethiddenwebformitem -- adds a hidden field to a form on a web page.
- webdatabasetoform -- fills in an HTML form with database field values.
- webfontsubstitutes -- generates an array of standard font substitutions for web browsers.
- webformallitems( -- returns a list of POST parameters passed from a form to the web server as a carriage return separated list.
- webformerrors( -- returns a list of errors that have been collected with the WebFormItemCheck statement.
- webformhiddenitems( -- returns a list of the hidden items in the web form submitted to this web procedure.
- webformitembang -- sets the text generated by the webformitembang( function.
- webformitemnames -- returns a list of POST parameters passed from a form to the web server as a carriage return separated list.
- webformitemnames( -- returns a list of POST parameters passed from a form to the web server as a carriage return separated list.
- webformitems( -- returns a list of POST parameters passed from a form to the web server, including both visible and invisible items (but excluding the special items Panorama generates for its own internal use).
- webformmerge -- fills in an HTML form with database values (fields and variables).
- webformrecordid -- adds a RECORD_ID hidden field to the HTML of a web form.
- webformselection -- selects data based on input from a web form. The web form must have fields that match the database fields.
- webformtodatabase -- updates the current database with information from the web form that was just submitted.
- webformvisibleitems( -- returns a list of the visible items in the web form submitted to this web procedure.
- webmerge -- merges an external HTML template file with fields and variables from the current record.
- webthisrecordkey -- makes a key for use with the WebURLSelect statement to specify the current record.

History

Version | Status | Notes
10.2 | No Change | Carried over from Panorama 6.0.