In my page there are two 'Conatct Selected' anchor button, one at the top having id as "selectAllLink" and other at the bottom having id as "selectAllLinkB" of the page. The top one working perfectly using the following script:
<script type="text/javascript">
$(function() {
$('#selectAllLink').each(function() {
var a = [];
var n = $("td.title_listing input:checked");
var s = "";
n.each(function() {
a.push(this.value);
});
s = a.join(',');
if (a.length > 0)
this.href = "/D_ContactSeller.aspx?property=" + s;
else
this.href = 'javascript:alert("Select at least one property to contact!");';
return false;
});
});
now for my bottom anchor button i tried to put it's id as 'selectAllLinkB' and changed the code like this:
<script type="text/javascript">
$(function() {
$('#selectAllLink, selectAllLinkB').each(function() {
var a = [];
var n = $("td.title_listing input:checked");
var s = "";
.....
.....
.....
});
Is there any simple method to call the script for both the anchor button event? waiting for the fast and good responce. Thanks in Advance...