Let's say I've got form like this:
$form = new HTML_QuickForm('Novinky');
$defaults = array('text' => '');
$form->setDefaults($defaults);
$elements['text'] = $form->addElement('textarea', 'text', 'Text', array('cols'=>55, 'rows'=>10, 'id'=>'text'));
$form->addElement('submit','save','Save');
if (isset($_POST[save])) {
if ($form->validate()) {
$form->process(array($this,'writeDB'));
}
}
After submit I want the default value to be shown instead of the value entered by user. Does Quickform have some functionality to achieve that or do I have to use something clumsy like:
$elements['text']->setValue( $defaults['text']);
.. in which case the setDefaults method seems bit useless to me...