louis_coetzee Posted June 14, 2010 Share Posted June 14, 2010 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!!! Quote Link to comment https://forums.phpfreaks.com/topic/204733-ajax-form-giving-wrong-url/ Share on other sites More sharing options...
bradmasterx Posted July 7, 2010 Share Posted July 7, 2010 You will have to show us the AJAX and form class in order to tell you what is wrong or if your using a framework to tell us what framework your using. Quote Link to comment https://forums.phpfreaks.com/topic/204733-ajax-form-giving-wrong-url/#findComment-1082508 Share on other sites More sharing options...
louis_coetzee Posted July 8, 2010 Author Share Posted July 8, 2010 Hi, I am using cakephp.....sorry for leaving that part out. Quote Link to comment https://forums.phpfreaks.com/topic/204733-ajax-form-giving-wrong-url/#findComment-1082911 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.