onsilence Event
Occurs when there has been no dual tone multi-frequency (DTMF) keypress before the time specified by the initialtimeout attribute expires.
HTML | <dtmf onsilence="noRecoHandler()"> |
Scripting | dtmf.onsilence = noRecoHandler; |
Named Script | <SCRIPT FOR = dtmf EVENT = onsilence> |
Remarks
The onsilence event halts the DTMF collection automatically. The dtmfResult and text properties are both set to null.
Although the event handler does not receive properties directly, the handler can query the event object for data.
Example
The following code demonstrates the use of the onsilence 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>