How to disable only certain links on JSP using jQuery
<p>I have been using a loop on JSP to call three different Struts actions but print the same parameters of data: </p>

<pre><code>&lt;a href="customize_business?method=add&amp;listingId=&lt;%=biz.getListingId()%&gt;&amp;bid=&lt;%=bid `%&gt;&amp;source=&lt;%=biz.getSource()%&gt;" class="ajax-link-add" id="addBus"&gt;&lt;img` `src="../images/green-tick.png" /&gt;&lt;/a&gt;
</code></pre>

<p>My jQuery is:</p>

<pre><code>$(function() {
    $('.ajax-link-add').click( function() {
        alert("in jquery fro add");
        $.get( $(this).attr('href'), function(msg) {
            if (msg!=null) {
                alert($.getAnchorValue('source', $('#addBus').attr('href')));
                $('#addBus').fadeTo('slow', 0.5, function() {
                    $('#addBus').removeAttr("href");
                });
            }
        });
        return false; 
    });
});
</code></pre>

<p>So output will be:</p>

<pre>
    CitySearch
    Mexican Village Restaurant            'a link to save in db' 'a link to delete from db'
    Yelp
    Mexican Village Restaurant            'a link to save in db' 'a link to delete from db'
    YahooLocal
    Mexican Village Restaurant            'a link to save in db' 'a link to delete from db'
</pre>

<p>Once a user clicks to save business name in CitySearch, all other records of Ciysearch should get greyedout and links disabled. But all records and links of Yelp and YahooLocal should be active for user to select one from each.</p>

<p>My current jQuery disables all records (Yelp,Citysearch,yahoolocal) and all links even if user clicks on any one link within any one source. I need him to select only one business on all 3 sources.</p>

<p>How should I change my jQuery? Thanks.</p>

<p>@Shadow: Thankyou. It worked and only links in one loop for one source get disabled. Each link has a 'check' and 'cross' to add and delete business from database. Once the user checks a business on a particular source, all add/delete links for that source get disabled using above code. But I want to keep only one delete link active, for user to be able to delete the selected business.</p>

<pre><code>&lt;a href="customize_business?method=add&amp;listingId=&lt;%=biz.getListingId()%&gt;&amp;bid=&lt;%=bid `%&gt;&amp;source=&lt;%=biz.getSource()%&gt;" class="ajax-link-add" id="addBus" source="`&lt;%=biz.getSource()%&gt;"&gt;&lt;img src="../images/green-tick.png" /&gt;&lt;/a&gt; &lt;a href="customize_business?method=delete&amp;listingId=&lt;%=biz.getListingId()%&gt;&amp;bid=&lt;%=‌​bid %&gt;&amp;source=&lt;%=biz.getSource()%&gt;" class="ajax-link-delete" id="deleteBus" source="&lt;%=biz.getSource()%&gt;"&gt;&lt;img src="../images/red-cross.png" /&gt;&lt;/a&gt;`
</code></pre>

<p>Jquery is:</p>

<pre><code>$(function() {
   $('.ajax-link-add').click( function() {

    var oLink = $(this);
         $.get( $(this).attr('href'), function(msg) {
             if (msg != null) {

                alert($.getAnchorValue('source', oLink.attr('href')));
                $("a[source='" +  oLink.attr("source") + "']").fadeTo('slow', 0.5, function() {
                $("a[source='" +  oLink.attr("source") + "']").removeAttr("href");

            });
          }
       });
   return false; 
   });
});

$(function() {
   $('.ajax-link-delete').click( function() {
    alert("in jquery fro add");
    var oLink = $(this);
         $.get( $(this).attr('href'), function(msg) {
             if (msg != null) {
                alert("in here 1 ");
                alert($.getAnchorValue('source', oLink.attr('href')));
                $("a[source='" +  oLink.attr("source") + "']").fadeTo('slow', 0.5, function() {
                $("a[source='" +  oLink.attr("source") + "']").removeAttr("href");
            });
          }
       });
   return false; 
   });
});
</code></pre>

<p>yes....so if I have </p>

<pre><code>Source: Citysearch 
Mexican Village Restaurant              add  delete
Mexican Town Restaurant                 add  delete
Chinese Restaurant                      add  delete

Source: Yelp
Mexican Village Restaurant              add  delete
Mexican Town Restaurant                 add  delete
Chinese Restaurant                      add  delete
</code></pre>

<p>Once user clicks on 'add' for CitySearch: Mexican Village Restaurant, all other records of only CitySearch should get grayed out with their links to add/delete disabled. Just the link to 'delete' of CitySearch: Mexican Village Restaurant should be active and enabled for user to delete that record from db and select some other business. When user selects other business, same thing should happen. Other businesses disabled and grayed out but link to delete for that particular chosen business should be active.</p>

<p>Meanwhile, all add/delete links on Yelp and other sources should be active.</p>
