Jump to content

ajax form giving wrong url


Recommended Posts

Hi, I am trying to make a ajax comment section in a blog inside the posts view.ctp, but I am getting the wrong url in the action part.


<?php echo $ajax->form('/comments/add','post',array('update'=>'comments')); ?>
<?php echo $form->input('Comment.name');?>
<?php echo $form->input('Comment.content');?>
<?php echo $form->input('Comment.post_id',array('type'=>'hidden','value'=>$post['Post']['id'])); ?>
<?php echo $form->end('Add Comment');?>


I get:

<form id="form1387038844" onsubmit="event.returnValue = false; return false;" method="post" action="/blog/posts/comments/add">

and the action part must be:

<form .......... action="/blog/comments/add"> instead of <form .......... action="/blog/posts/comments/add">


Please help!!!

Link to post
Share on other sites
  • 4 weeks later...


This topic is now archived and is closed to further replies.

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.