You haven't said what Magento version
Something like this should work with Magento 1
https://www.magespider.com/how-to-add-quantity-box-on-product-list-page-in-magento/
<button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" onclick="setLocation('<?php echo $this->getAddToCartUrl($_product) ?>')"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button>
<?php $product_id=$_product->getId() ?>
<?php $base_url=Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK);?>
<label for="qty"><?php echo $this->__('Qty:') ?></label>
<input type="text" name="qty" id="<?php echo $product_id ?>" maxlength="12" value="1" title="<?php echo $this->__('Qty') ?>" class="input-text qty"></input>
<button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" onClick="addToCart('<?php echo $product_id ?>','<?php echo $base_url?>')"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button>
<script type="text/javascript">
function addToCart(pid,purl)
{
var qty=document.getElementById(pid).value;
var action=purl+"checkout/cart/add/product/"+pid+"/qty/"+qty;
window.location=action;
}
</script>