ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Comment form not working

September 08, 2008 7:19pm

Subscribe [2]
  • #1 / Sep 08, 2008 7:19pm

    duckndive

    11 posts

    Can anyone tell me what I’m doing wrong with this basic comment form? What happens when the page is viewed is that the Name input field actually shows the name tag as a text string {name}, and the same is true for the Comment text area (it contains the literal string {comment}), while the email field is populated with the system default email address. And on top of all that, the form doesn’t actually send anything to the database. 

    <fieldset>
    {exp:comment:form}<legend>Comment Form</legend>
    <label for="Name">Name*</label>
    <input name="Name" type="text" class="formtxt" id="Name" value="{name}"/></p>  
    <label for="Email">Email*</label>
    <input name="Email" type="text" class="formtxt" id="Email" value="{email}" /></p>
    <label for="textarea">Comment</label>
    <textarea name="comment" id="comment" cols="45" rows="5">{comment}</textarea></p>
    <label for="Submit">Submit</label>
    <input name="Submit" type="submit" class="formbtn" id="Submit" value="Submit" /></p>
    </exp:comment:form} </fieldset>

    [Mod Edit: Moved to the Technical Support forum]

  • #2 / Sep 08, 2008 7:39pm

    Sue Crocker

    26054 posts

    Hi, duckndive.

    When you are viewing the comments template, does the URI have the url_title in in?

    An example would be:

    <a href="http://example.com/index.php/site/comments/this-is-an-entry">http://example.com/index.php/site/comments/this-is-an-entry</a>

    Where this-is-an-entry is the URL title of a weblog entry called This is an Entry.

    All by itself, the comment form won’t work.

    Could that be the case?

  • #3 / Sep 09, 2008 4:43pm

    duckndive

    11 posts

    Mmmm, yes, I think that this aspect of the template is working OK.
    Here’s my test home page with dummy articles.

    <a href="http://s219719224.websitehome.co.uk/index.php/site/index/">http://s219719224.websitehome.co.uk/index.php/site/index/</a>

    Clicking on a Read more link (say the top article), leads to this page:

    <a href="http://s219719224.websitehome.co.uk/index.php/home_articles/single_article/mifid_project_management/">http://s219719224.websitehome.co.uk/index.php/home_articles/single_article/mifid_project_management/</a>

    As you may see (or not, as the case may be!) the tags appear in the comment form field on the single_article page. NOTE: I’ve removed the email value tag for the time being.

    I came across a similar problem being reported on Core Tech support forum, but the OP subsequently reported that the problem had fixed itself. Sorry to say that that is not the case with me.

    Very much appreciate any guidance. Hosting issue?

  • #4 / Sep 09, 2008 4:51pm

    Sue Crocker

    26054 posts

    Well, the first thing I’d suggest doing is to use the comments template found in the EEDocs:

    EEDocs:// Entry Submission Form

    You don’t appear to be using any sort of logic to determine if the person viewing the page is logged in or not. One you add that to your code, everything should display OK. When someone is logged in already, EE knows their name and other info.

    Make sense?

  • #5 / Sep 10, 2008 9:55am

    duckndive

    11 posts

    FIXED

    Thank you Sue for helping. In the end I wiped everything out and started afresh, after which the form worked fine (with the original code too).

    I’ve no idea what the problem was, but it is working now, and that’s the main thing.

  • #6 / Sep 10, 2008 10:09am

    Sue Crocker

    26054 posts

    Glad to hear that things are working again, duckndive. Don’t hesitate to post again if needed.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases