Hello,
An awkward thing occurs when I'm trying to submit a form with the AJAX
helper and fck editor applied to a textarea.
The textarea is already loaded with a value from the database (I'm
updating newsposts). When I submit the form (only textarea) the new
value is not passed to the controller $this->data. The old value
appears.
Though, if I hit the submit button again... it does post the new
value.
If I do this repeatedly while altering the textarea value it seems
that the controller $this->data gets loaded with the previous form
value. So it is always one step behind.
As soon as I remove the fck functionality the effect disappears.
Can anyone shed some light on it?
My view:
echo $ajax->div('adiv');
echo $post['Post']['body'];
echo $ajax->divEnd('adiv');
echo $ajax->form('/posts/returnTest', 'Post',
array('update'=>'adiv'));
//echo $fck->load(null,100,400,null);
echo $form->input('Post.body', array('label'=>'', 'type'=>'textarea',
'value'=> html_entity_decode($post['Post']['body'])));
//echo $fck->editor('Post.body');
echo $form->submit();
echo $form->end();
echo '<br/>';
My Controller:
function returnTest(){
$data = $this->data;
$this->set('post',$data['Post']['body']);
$this->render('testdiv','ajax');
}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---