Hello again. There is a script - http://jsfiddle.net/oceog/kKs8g/4/
I need it in order to make quick replies to comments.
I put it on my engine, but the form with comments is shown as many times as there are comments on the page. Whatever it was, I was advised to give the ID form / button a form that opens. In my template with comments there is a line php - <?php echo $post['id']; ?> <?php echo $post['id']; ?> , which gives a unique ID to each comment.

 <a class="<?php echo $post['id']; ?>" href="javascript://" title="Показать\Скрыть блок">Показать</a> <div class="<?php echo $post['id']; ?>">Здесь располагается форма"</div> </div> 

Everything is clear, where to add, but how do I add <?php echo $post['id']; ?> <?php echo $post['id']; ?> in jquery script? How not tried - did not work.
Help me please.

  • <?php echo $post['id']; ?> <?php echo $post['id']; ?> not needed in js, just take the id of the parent element when posting a comment. make a fiddle with your generated content so that it is clear exactly how everything looks in reality and what doesn't work. - zb '
  • Again you. rghost.ru/44385472 Here, flooded the entire page template, commented everything. - gm-111
  • Yes, your php source is not needed, copy the source of the page from the browser and paste jsfiddle - zb '
  • Yeah, I’d still have to make it more than one kommet and show / hide button (is this what no?) - zb '
  • jsfiddle.net/hpF6C/1 Here is the whole page, 3 comments. No, there I cut it. Here this button is the same as in the first script of the very first message. - gm-111

1 answer 1

Hmm

 $(function(){ var form = $('#postform'); $('a.script-a').click(function(){ form.insertAfter( $(this).parents('table.post_table').eq(0) ); return false; }); }); 
  • If I needed to add this code to that, or replace it with this, it does not work. - gm-111
  • one
    You have links to the code - damn your leg will break, to be honest. Broken wakab, along with some kind of plug-in scripts that can not be loaded. The jquery is loaded twice. Are you aware that you want to place one form inside another? If not fundamentally - take better kusabu. - istem
  • > which can not be loaded For all, everything works fine. > take better kusabu. Very funny. - gm-111
  • one
    You have already given so many tips, but you still can’t do it. Here, no one is going to do your work for you. Advise - this is please. Here's another one:> The successful application of these very tips depends on your level of intelligence. - istem 7:49 pm
  • Yes. This file contains a script that adds text to the form on a click. Does it work, sucked? > Here, no one is going to do your work for you. Yes of course. It's so hard to replace a couple of characters in the code. > The successful application of these very tips depends on the level of knowledge of programming languages. Corrected, do not thank. - gm-111