I am using 1.2RC2 and the FIRST TIME IT WORKS...when I save the data
to the table using Ajax... 2nd time it fails unless I refresh the
page.  So I get one update before I get the following error replaced
into my div:
Not Found

Error: The requested address '/golearns/saveprof' was not found on
this server.



I have a simple form with one textarea:
<?=$form->create('Golearn')?>
    <div id="golearn_textarea">
        <?=$form-
>input('body',array('label'=>false,'div'=>false,'error'=>false,'type'=>'textarea','id'=>'notes_text'))?
>
    </div>
    <div class="golearn_notes_btns">
          <?=$ajax->submit("Save Profile",array('url'=>'/golearns/
saveprof','update'=>'golearn_textarea','class'=>'golearn_save_btn'))?>
    </div>
<?=$form->end()?>


My controller has:
        function saveprof() {
                if (!empty($this->data)) {
                        $this->Profile->create();
                        $this->data['Profile']['user_id'] = 
$this->Auth->user('id');
                        $this->data['Profile']['type'] = 'notes';
                        $this->data['Profile']['notes'] = 
$this->data['Golearn']['body'];
                        if ($this->Profile->save($this->data)) {
                                $this->render('add_success','ajax');
                                //exit();
                        }
                }
        }


the add_success.ctp is setup to replace the Textarea with a new
Textarea swapping out the text:
<?=$form-
>input('body',array('label'=>false,'div'=>false,'error'=>false,'type'=>'textarea','id'=>'notes_text','value'=>'Notes
saved to profile.'))?>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to