Platform SDK: Web Telephony Engine

Terminating Input

The WTEApplication object includes a property called InputTerminator. This property is associated with all TEXTAREA elements and text-type INPUT elements in an application. It defines a string that the caller enters when finished entering data into a data-entry field. The string signals the WTE that the entry field has been satisfied and that it can continue rendering the application. A typical input terminator is the pound key (#). An application often specifies the input terminator before each entry field. For example, an application might say, "Please enter your age followed by the pound key".

For a text-type INPUT element, you can use the MAXLENGTH attribute to set the maximum number of characters for the element's entry field. Caller input into the entry field terminates as soon as the user enters the last character. The MAXLENGTH attribute is useful for getting data items of a predetermined length, such as a credit card number. Note that setting the MAXLENGTH attribute does not disable the role of the InputTerminator property. The caller can still end data input by entering the input terminator before entering the maximum number of characters.

An empty string is allowed for the InputTerminator property. However, Web telephony logs an authoring warning when the termination string is empty and there is no way out of an entry field without the help of scripts; for example, if there is no input terminator and no MAXLENGTH attribute.

You can use time-out intervals to terminate caller input into an entry field. For example, you could set the InterTimeoutInterval property to a small value. When the caller stops entering digits and the time-out interval expires, the WTE fires the onselectiontimeout event. Your handler for this event could ask the caller if they are finished entering data. For more information about how to handle time-outs, see Handling Time-outs and Non-valid Keys.

Finally, you can use event handlers to terminate input to an entry field. For example, an auto-attendant application might tell the caller to enter an extension number, or press 1 for sales, 2 for support, and so on. The application could include an event handler for the onchange event to check each digit that the caller enters into the entry field. If the event handler detects a 1 or 2, the handler would navigate to the sales or support page. Otherwise, the application would wait for the caller to fill the entry field to the maximum number of digits for extension numbers, and then transfer the call to the given extension.