Jump to content

ajax form giving wrong url


louis_coetzee

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 comment
Share on other sites

  • 4 weeks later...
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.