problem with serialize
<p>I dont think I could explain it in the title. Its very hard to explain it. There is an area where there are multiple forms and I use serialize there. When a user responds to one of the forms, an output comes and replaces the form. But I want it to replace the friendlist div.</p>

<p>I needed to create a facebook like social network for a school project. I use serialize on friendship requests page because users may have multiple forms at that page. Problem here is, when user submits one of the forms, it takes the response and replaces all forms with same response where I want it replace the form that is submitted.</p>

<p>I hope I could explain it better here. </p>

<p>My jquery code</p>

<pre><code>    $("[name='respond']").live('click', function() { 
        var RequestForm = $(this).closest('#REQUESTFORM');
        $("[name='action']").val($(this).val());
            $.ajax({
                type: "POST",
                data: RequestForm.serialize(),
                url: "index.asp?Process=RespondRequests", 
                success: function(output) { 
                    $(".friendlist").html(output);
                },
                error: function (XMLHttpRequest, textStatus, errorThrown) {
                    $(".friendlist").html(output);
                }
            }); 
    }); 
</code></pre>

<p>example</p>

<pre><code>                        &lt;div class="friendlist"&gt;

                            &lt;a href="#"&gt;&lt;img src="images/btn_icon_friendlist.jpg" alt="EfeTuncel" class="profile" /&gt;&lt;/a&gt;
                            &lt;div class="userinfo"&gt;
                                &lt;span&gt;&lt;strong&gt;&lt;a href="#"&gt;Efe&amp;nbsp;Tuncel&lt;/a&gt;&lt;/strong&gt;&lt;/span&gt;
                                &lt;span&gt;Istanbul, Türkiye&lt;/span&gt;
                            &lt;/div&gt;
                            &lt;div class="commonfriends"&gt;13 common friends&lt;/div&gt;
                            &lt;div class="tools"&gt;

                                &lt;form method="post" action="content/requests/index.cs.asp?Process=RespondRequests" id="REQUESTFORM"&gt;
                                    &lt;p&gt;
                                        &lt;input type="button" name="respond" value="Confirm" class="btn_confirm" /&gt;
                                        &lt;input type="button" name="respond" value="Ignore" class="btn_ignore" /&gt;
                                    &lt;/p&gt;
                                &lt;/form&gt;                                  
                            &lt;/div&gt;                        
                        &lt;/div&gt;


                        &lt;div class="friendlist"&gt;
                            &lt;a href="#"&gt;&lt;img src="images/btn_icon_friendlist.jpg" alt="talipkÃ¶sem" class="profile" /&gt;&lt;/a&gt;
                            &lt;div class="userinfo"&gt;
                                &lt;span&gt;&lt;strong&gt;&lt;a href="#"&gt;talip&amp;nbsp;kÃ¶sem&lt;/a&gt;&lt;/strong&gt;&lt;/span&gt;
                                &lt;span&gt;Istanbul, Türkiye&lt;/span&gt;
                            &lt;/div&gt;
                            &lt;div class="commonfriends"&gt;13 common friends&lt;/div&gt;

                            &lt;div class="tools"&gt;
                                &lt;form method="post" action="content/requests/index.cs.asp?Process=RespondRequests" id="REQUESTFORM"&gt;
                                    &lt;p&gt;
                                        &lt;input type="button" name="respond" value="Confirm" class="btn_confirm" /&gt;
                                        &lt;input type="button" name="respond" value="Ignore" class="btn_ignore" /&gt;
                                    &lt;/p&gt;

                                &lt;/form&gt;                                  
                            &lt;/div&gt;                        
                        &lt;/div&gt;
</code></pre>
