Hey,

this is my first post, so please be gentle to me ;)

I've created an ajax form to submit some data (nothing special here).
When this data is verified I'd like to redirect to another action in
the same or another controller (error occurs with both variants). This
also should be nothing special ($this->redirect('controller/action')).

But here's my problem:
In this new action I'd also like to create an ajax form with just a
Button to confirm the selection the user made in the action before (a
'confirm order' button).
When I now click on the button I just get no text at the output.
After hours of debugging I figured out that the hidden _Token field is
missing. I did a pr($this->params) in the redirected controller and
see: no _Token :(

Is it somehow possible to manually create a new Token so that the form
in the redirected action works? Or is there a better solution?


All this works with normal forms. It also works when I don't leave the
controller action where the form-view is called form. It just happens
when I redirect to another action which also has a form in the view.



some code snippets:

*orderselect view*
<div id="ajaxcontainer">
<?
$options = array(
        'url' => array('controller' => 'servicetypes', 'action' =>
'orderselect'),
        'before' => 'startLoading()',
        'complete' => 'endLoading()',
        'falure' => 'failure()',
        'update' => 'ajaxcontainer');
echo $ajax->form(array('controller' => 'servicetypes', 'action' =>
'orderselect'),'post', $options);
$options = array(
'type' => 'radio',
'options' => $vals,
'legend' => __('Order',true),
'value' => $service['Serviceprice'][0]['id']
);
echo $form->input('Serviceprice.id',$options);
echo $form->end(__('Order now',true));
?>
</div>

*orderselect controller*
function orderselect() {
  if ( $verified ) {
       $this->redirect('/servicetypes/confirmorder/'.$productid);
  }
}


*confirmorder view where now the _Token is missing*
$options = array(
        'url' => array('controller' => 'services', 'action' => 'placeorder'),
        'before' => 'startLoading()',
        'complete' => 'endLoading()',
        'falure' => 'failure()',
        'update' => 'ajaxcontainer');
echo $ajax->form(array('controller' => 'services', 'action' =>
'placeorder'),'post', $options);
echo $form->input('Servicetype.id',array('value' => $order
['Servicetype']['id']));
echo $form->input('Serviceprice.id',array('value' => $order
['Serviceprice']['id']));
echo $form->end(__('Order now',true));

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to