Partager via


onnoreco Event

  Microsoft Speech Technologies Homepage

Occurs when a dual tone multi-frequency (DTMF) key is pressed that is not valid according to the DTMF grammar, or when the interdigit time-out period is exceeded.

HTML <dtmf onnoreco="noRecoHandler()">
Scripting dtmf.onnoreco = noRecoHandler;
Named Script <SCRIPT FOR = dtmf EVENT = onnoreco>

Remarks

A DTMF session ends when the proper number of digits has been collected or the interdigittimeout time-out has expired. The dtmfresult and text properties are filled with the Semantic Markup Language (SML) result and the collected digit string, respectively.

The onnoreco event stops DTMF collection automatically, appends the text property with the pressed key, updates dtmfresult and sets the status property according to the following table.

Status Value Description
-13 An invalid (out of grammar) keypress was detected.
-16 No DTMF input was detected within the period specified by the interdigittimeout attribute.
-30 DTMF collection was attempted after a disconnect.

Although it does not receive properties directly, the event handler can query the status property of the dtmf element for data about the event.

Example

The following code demonstrates the use of the onnoreco event.

<html xmlns:salt="http://www.saltforum.org/2002/SALT">
  ...
  <body>
    <input type="text" name="iptAreaCode" onFocus="dtmfAreaCode.Start()" />
    <input type="text" name="iptPhoneNumber" />
    ...
    <salt:dtmf id="dtmfAreaCode" onkeypress="dtmfKeyPressHandler()" onreco="dtmfPhoneNumber.Start()"    onsilence="dtmfSilenceHandler()" onerror="dtmfErrorHandler()" onnoreco="dtmfErrorHandler()"    initialtimeout="5000" interdigittimeout="2000" preflush="true">
      <!-- grammar result will contain "smlAreaCode" node -->
      <salt:grammar src="3digits.grxml" />
      <salt:bind value="//smlAreaCode" targetelement="iptAreaCode" />
    </salt:dtmf>
    <salt:dtmf id="dtmfPhoneNumber" onkeypress="dtmfKeyPressHandler()" onerror="dtmfErrorHandler()"    initialtimeout="5000" interdigittimeout="2000" preflush="true">
       <!-- grammar result will contain "smlPhoneNumber" node -->
      <salt:grammar src="7digits.grxml" />
      <salt:bind value="//smlPhoneNumber" targetelement="iptPhoneNumber" />
    </salt:dtmf>
    <script language="jscript">
    <!--
      function dtmfSilenceHandler() {
        ...
      }
  
      function dtmfErrorHandler() {
        ...
      }
      
      function dtmfKeyPressHandler() {
        ...
      }
      -->
      </script>
  <body>
</html>

See Also

dtmf Element | prompt Element | grammar Element | dtmfresult Property | interdigittimeout Attribute | text Property