HAWHAW

PHP

Class HAW_input

HAW_input

public class HAW_input

This class provides a text input field in a HAW_form object.

Examples:

$myInput1 = new HAW_input("cid", "", "Customer ID");

$myInput2 = new HAW_input("cid", "", "Customer ID", "*N");
$myInput2->set_size(6);
$myInput2->set_maxlength(6);

$myInput3 = new HAW_input("pw", "", "Password", "*N");
$myInput3->set_size(8);
$myInput3->set_maxlength(8);
$myInput3->set_type(HAW_INPUT_PASSWORD);

See Also:
HAW_form

Constructor Summary
HAW_input(var $name, var $value, var $label, var $format)
          Constructor
 
Method Summary
 void set_br(var $br)
          Sets the number of line breaks (CRLF) after input field (default: 1).
 void set_maxlength(var $maxlength)
          Set maximum of allowed characters in the input field.
 void set_mode(var $mode)
          Set input mode/istyle for japanese MML/i-mode devices
 void set_size(var $size)
          Set size of the input field.
 void set_type(var $type)
          Set input type
 void set_voice_grammar(var $src, var $type)
          Defines an external grammar for an input field in voice decks.
 void set_voice_help(var $text, var $audio_src, var $url)
          Sets help text for voice browsers.
 void set_voice_noinput(var $text, var $audio_src, var $url)
          Sets noinput text for voice browsers.
 void set_voice_nomatch(var $text, var $audio_src, var $url)
          Sets nomatch text for voice browsers.
 void set_voice_text(var $text, var $audio_src)
          Sets text to be spoken by voice browsers.
 void set_voice_type(var $type)
          Sets the type of the input field in voice decks (default: "digits").
 

Constructor Detail

HAW_input

public HAW_input(var $name,
                 var $value,
                 var $label,
                 var $format)
Constructor
Parameters:
name - Variable in which the input is sent to the destination URL.
value - Initial value (string!) that will be presented in the input field.
label - Describes your input field on the surfer's screen/display.
format - (optional, default: "*M")
Input format code according to the WAP standard. Allows the WAP user client e.g. to input only digits and no characters.
Method Detail

set_size

public void set_size(var $size)
Set size of the input field.
Note: Will be ignored in case of HDML/VoiceXML output.
Parameters:
size - Number of characters fitting into the input field.

set_maxlength

public void set_maxlength(var $maxlength)
Set maximum of allowed characters in the input field.
Note: Will be ignored in case of HDML output.
Parameters:
maxlength - Maximum number of characters the user can enter.

set_type

public void set_type(var $type)
Set input type
Parameters:
type - Allowed values: HAW_INPUT_TEXT (default) or HAW_INPUT_PASSWORD.

set_mode

public void set_mode(var $mode)
Set input mode/istyle for japanese MML/i-mode devices
Parameters:
mode - input mode
HAW_INPUT_ALPHABET (default)
HAW_INPUT_KATAKANA
HAW_INPUT_HIRAGANA
HAW_INPUT_NUMERIC

set_br

public void set_br(var $br)
Sets the number of line breaks (CRLF) after input field (default: 1).
Note: Has no effect in WML/HDML.
Parameters:
br - Some number of line breaks.

set_voice_text

public void set_voice_text(var $text,
                           var $audio_src)
Sets text to be spoken by voice browsers.
Parameters:
text - Some alternative text that replaces <label>.
audio_src - Some audio file (e.g. *.wav file) to play (optional).

set_voice_type

public void set_voice_type(var $type)
Sets the type of the input field in voice decks (default: "digits").
Note: Support of builtin grammar types is platform specific. The W3C VoiceXML Version 2.0 recommendation defines these grammar types:
Parameters:
type - String with grammar type.

set_voice_grammar

public void set_voice_grammar(var $src,
                              var $type)
Defines an external grammar for an input field in voice decks.
Attention: This function should be used by experienced VoiceXML developers only! Please refer to the W3C VoiceXML Recommendation for detailled info about grammar definitions.
Parameters:
src - URL specifying the location of the grammar, e.g. "http://www.foo.com/myinput.grxml".
type - Media type of the grammar, e.g. "application/srgs+xml".

set_voice_help

public void set_voice_help(var $text,
                           var $audio_src,
                           var $url)
Sets help text for voice browsers.
Parameters:
text - Some helpful information concerning this input.
audio_src - Some audio file (e.g. *.wav file) to play (optional).
url - Some other voice deck to go to (optional).

set_voice_noinput

public void set_voice_noinput(var $text,
                              var $audio_src,
                              var $url)
Sets noinput text for voice browsers.
Parameters:
text - Some text to inform the user that no input has been received.
audio_src - Some audio file (e.g. *.wav file) to play (optional).
url - Some other voice deck to go to (optional).

set_voice_nomatch

public void set_voice_nomatch(var $text,
                              var $audio_src,
                              var $url)
Sets nomatch text for voice browsers.
Parameters:
text - Some text to complain that user input was not recognized.
audio_src - Some audio file (e.g. *.wav file) to play (optional).
url - Some other voice deck to go to (optional).

© Norbert Huffschmid
assembled from PHP source
using sed and javadoc