quite a few ways of doing this that you have hinted at.
But as a start let's go the php route.
The file you need is includes/modules/YOUR_TEMPLATE/product_listing.php . If the override version does not exist then create it.
Where exactly you put this code depends on your set up. What I mean by that is if you have multiple add to cart selected or not. I believe that you have multiple switched on so....
You are looking for this in product_listing about line 135ish:
Code:
} else {
$lc_button = '<a href="' . zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing->fields['products_id']) . '">' . zen_image_button(BUTTON_IMAGE_BUY_NOW, BUTTON_BUY_NOW_ALT, 'class="listingBuyNowButton"') . '</a>';
}
which you want to replace with
Code:
} else {
if(!$notfirst)
{
$string = ' id="first_input" ';
$notfirst = true;
}else{
$string = '';
}
$lc_button = TEXT_PRODUCT_LISTING_MULTIPLE_ADD_TO_CART . "<input".$string." type=\"text\" name=\"products_id[" . $listing->fields['products_id'] . "]\" value=\"0\" size=\"4\" />";
}
What that will do is add a new id (#first_input) to the first input on the page. Then you can target that with javascript easily.
There are other ways of doing this. For instance jQuery would make targeting that element much easier without php changes and you could probably find a way to do it in straight javascript. But this should work.
I am guessing that that is enough to get you rolling.