There's defenetly a problem with the zend dojo editor.
When I add a form in my controller, everything works fine, I can read the content of the editor.
Howerver when I put the exact same form in a class file, I won't be able to access the text the user wrote.
This works (in my controller) :
$form = new Zend_Dojo_Form;
$form->setAction('/manager/edit');
$form->setMethod('post');
$form->addElement(
'TextBox',
'title',
array(
'value' => '',
'label' => 'Title : '));
$form->addElement(
'Editor',
'comments');
$form->addElement(
'DateTextBox',
'foo',
array(
'label' => 'Date:',
'required' => true,
'formatLength' => 'long',
)
);
$form->addElement(
'SubmitButton',
'save'
);
echo $form;
/* great I can see user's content in print_r($_POST); */
This, however does't work :
/* My File : PostForm.php */
class PostForm extends Zend_Dojo_Form
{
public function init()
{
$this->setName('Login');
$this->setAction('/manager/edit')
->setMethod('post');
$this->addElement(
'TextBox',
'title',
array(
'value' => '',
'label' => 'Title : ')
);
$this->addElement(
'Editor',
'comments');
$this->addElement(
'DateTextBox',
'foo',
array(
'label' => 'Date:',
'required' => true,
'formatLength' => 'long',
)
);
$this->addElement(
'SubmitButton',
'save'
);
}
}
And in my controller :
print_r($_POST);
$form = new PostForm();
echo $form;
I'm unable to see anything I write in the "comments" variable.
Z.
When I add a form in my controller, everything works fine, I can read the content of the editor.
Howerver when I put the exact same form in a class file, I won't be able to access the text the user wrote.
This works (in my controller) :
$form = new Zend_Dojo_Form;
$form->setAction('/manager/edit');
$form->setMethod('post');
$form->addElement(
'TextBox',
'title',
array(
'value' => '',
'label' => 'Title : '));
$form->addElement(
'Editor',
'comments');
$form->addElement(
'DateTextBox',
'foo',
array(
'label' => 'Date:',
'required' => true,
'formatLength' => 'long',
)
);
$form->addElement(
'SubmitButton',
'save'
);
echo $form;
/* great I can see user's content in print_r($_POST); */
This, however does't work :
/* My File : PostForm.php */
class PostForm extends Zend_Dojo_Form
{
public function init()
{
$this->setName('Login');
$this->setAction('/manager/edit')
->setMethod('post');
$this->addElement(
'TextBox',
'title',
array(
'value' => '',
'label' => 'Title : ')
);
$this->addElement(
'Editor',
'comments');
$this->addElement(
'DateTextBox',
'foo',
array(
'label' => 'Date:',
'required' => true,
'formatLength' => 'long',
)
);
$this->addElement(
'SubmitButton',
'save'
);
}
}
And in my controller :
print_r($_POST);
$form = new PostForm();
echo $form;
I'm unable to see anything I write in the "comments" variable.
Z.
> > Gives me this :
> > array(4) { ["title"]=> string(7) "xbvcbvc" ["content"]=> string(0) "" ["date"]
> > => string(10) "2008-09-20" ["id"]=> string(0) "" } not valid form
>
> Um... I'm not seeing anything in the "content" value currently -- and if
> you marked it as required, then an empty value would be invalid.
Tous vos amis discutent sur Messenger, et vous ? Téléchargez Messenger, c'est gratuit !
没有评论:
发表评论