Support » Themes and Templates » Multiple comment forms on one page

  • I have a one page site with multiple comment forms on it. Look at it here:

    Since the comment form uses IDs, and doesn’t generate a unique ID for the elements of each form, it’s causing some problems. Submitting the form is fine, but clicking on the label of any form but the first one will jump you over to the first form. Also, this causes Ajax to only function on the very first form. I tried adding classes to all of the elements and only referencing them in the Ajax .js file, but that completely broke it.

    Anyone have any ideas on this? I see this has been asked some on here, with few answers. Thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Nevermind, solved it. I just added class names to the form elements in the comment form function, and then changed the .js file in my ajax plugin to reference the classes instead of the IDs.

    So that solved the Ajax problem, now I just have the less serious issue of the notifications showing up on all of the forms instead of just the one that’s being submitted.

    alancrissey, I’m having the exact problem you reference here. Here’s my page with multiple comment forms (inside the Fancbox pop-ups for each image):

    But when I add a class name to my comment forms by creating a <div class="comment-form"> around my <?php comment_form(); ?> and then change my ajax .js to reference that rather than #commentform id it doesn’t work.

    Can you let me know what plugin you were using? Any tips?


Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Multiple comment forms on one page’ is closed to new replies.