logo       
Google Custom Search
    AddThis Social Bookmark Button

Re: [QuickForm] How should i use applyFilter(): msg#00200

Subject: Re: [QuickForm] How should i use applyFilter()
<eltehaem@xxxxxxxxxxxxxx> wrote :

> $form = new HTML_QuickForm('frmTest', 'GET');
> 
> $form->addElement('text', 'itxtTest', 'Test Text:');
> $form->applyFilter('__ALL__', 'trim');
> 
> if ($form->validate()) {
>   $form->freeze();
>   echo '<pre>';
>   echo $form->getElementValue('itxtTest');
>   echo '</pre>';
> }
> 
> $form->display();

$form = new HTML_QuickForm('frmTest', 'GET');

$form->addElement('text', 'itxtTest', 'Test Text:');
$form->addElement('submit', 'submit', 'submit');
$form->addRule('itxtTest', 'Test text is required', 'required');
$form->applyFilter('__ALL__', 'trim');

if ($form->validate()) {
    $form->freeze();
    echo 'Before filter:<pre>';
    echo $form->getElementValue('itxtTest');
    echo '</pre>';
    echo 'After filter:<pre>';
    var_dump($form->_submitValues['itxtTest']);
    echo '</pre>';
}
$form->display();


--
PEAR General Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php





Try Searching:
servers, voip, java, networking, microsoft ...
<Prev in Thread] Current Thread [Next in Thread>