Problems, need help? Have a tip or advice? Post it here.
6 posts Page 1 of 1
Hi, I'm trying to implement a comments form into a website.

I took the example that's on the Comments documentation page, however the problem is that when I try to submit a comment I'm being redirected to the homepage, while the browser address bar says: /#kformname0

Here's the source that's being generated:

Code: Select all
<form  method="post" class="k_form" name="kformname0" action="#kformname0" accept-charset="utf-8">


Has this something to do with htaccess redirects?
Hi,

Is the site online? Please PM me a link to the page, if it is.

Also, have you modified the comment form in any way?

Please let me know.
Thanks
The site is not online yet, I'm developing locally.

I didn't change much to the comments code, except some language specific things. I placed the form in a separate file name '_comments.html' and placed it in the 'snippets' folder.

Code: Select all
<cms:if k_is_commentable >
<div class="comment-form" >

    <cms:form method="post" class="k_form">

Form stuff

    </cms:form>
   
</div>
</cms:if>
Well, in that case the only thing I can do is try and see if the code has to do something with the problem.

Please PM me all the involved code (template, snippets etc.) and I'll see if I can spot anything.

Thanks.
Thanks for setting up the site on a dev server for me to see the problem.

I had a look and the problem is the following statement in your template (URL changed)
Code: Select all
<base href="http://www.yoursite.com/">

The base href is making the form's action point to the site's homepage (which is what you complained about).

As a resolution, please try explicitly specifying the form' action this way -
<cms:form method="post" class="k_form" action="<cms:show k_page_link />" >

Hope this helps.
Please let us know.
Yes, I can confirm it's working!

I guess I could delete <base href> as well as it's no longer relevant for this specific site.

Thank you very much! :D
6 posts Page 1 of 1
cron