<?xml version="1.0" encoding="UTF-8"?>
<!-- Reviewed: no -->
<sect2 id="zend.validate.set.alnum">
    <title>Alnum</title>

    <para>
        <classname>Zend_Validate_Alnum</classname> allows you to validate if a given value contains
        only alphabetical characters and digits. There is no length limitation for the input
        you want to validate.
    </para>

    <sect3 id="zend.validate.set.alnum.options">
        <title>Supported options for Zend_Validate_Alnum</title>

        <para>
            The following options are supported for <classname>Zend_Validate_Alnum</classname>:
        </para>

        <itemizedlist>
            <listitem>
                <para>
                    <emphasis><property>allowWhiteSpace</property></emphasis>: If whitespace
                    characters are allowed. This option defaults to <constant>FALSE</constant>
                </para>
            </listitem>
        </itemizedlist>
    </sect3>

    <sect3 id="zend.validate.set.alnum.basic">
        <title>Basic usage</title>

        <para>
            A basic example is the following one:
        </para>

        <programlisting language="php"><![CDATA[
$validator = new Zend_Validate_Alnum();
if ($validator->isValid('Abcd12')) {
    // value contains only allowed chars
} else {
    // false
}
]]></programlisting>
    </sect3>

    <sect3 id="zend.validate.set.alnum.whitespace">
        <title>Using whitespaces</title>

        <para>
            Per default whitespaces are not accepted because they are not part of the alphabet.
            Still, there is a way to accept them as input. This allows to validate complete
            sentences or phrases.
        </para>

        <para>
            To allow the usage of whitespaces you need to give the
            <property>allowWhiteSpace</property> option. This can be done while creating an instance
            of the validator, or afterwards by using <methodname>setAllowWhiteSpace()</methodname>.
            To get the actual state you can use <methodname>getAllowWhiteSpace()</methodname>.
        </para>

        <programlisting language="php"><![CDATA[
$validator = new Zend_Validate_Alnum(array('allowWhiteSpace' => true));
if ($validator->isValid('Abcd and 12')) {
    // value contains only allowed chars
} else {
    // false
}
]]></programlisting>
    </sect3>

    <sect3 id="zend.validate.set.alnum.languages">
        <title>Using different languages</title>

        <para>
            When using <classname>Zend_Validate_Alnum</classname> then the language which the user
            sets within his browser will be used to set the allowed characters. This means when your
            user sets <emphasis>de</emphasis> for german then he can also enter characters like
            <emphasis>ä</emphasis>, <emphasis>ö</emphasis> and <emphasis>ü</emphasis> additionally
            to the characters from the english alphabet.
        </para>

        <para>
            Which characters are allowed depends completly on the used language as every language
            defines it's own set of characters.
        </para>

        <para>
            There are actually 3 languages which are not accepted in their own script. These
            languages are <emphasis>korean</emphasis>, <emphasis>japanese</emphasis> and
            <emphasis>chinese</emphasis> because this languages are using an alphabet where a
            single character is build by using multiple characters.
        </para>

        <para>
            In the case you are using these languages, the input will only be validated by using
            the english alphabet.
        </para>
    </sect3>
</sect2>
<!--
vim:se ts=4 sw=4 et:
-->
