Я перепробовал все:
document.getElementById('buy').setAttribute('disabled','false');
document.getElementById('buy').setAttribute('disabled',false);
document.getElementById('buy').removeAttribute('disabled');
document.getElementById('buy').disabled=false;
Подтверждение ввода ранее было подтверждено php:
if (empty($basketproductos)) {
echo "<input type='submit' name='buy' value='Buy' disabled='disabled' id='buy'/>";
}
Также пробовал с отключенным = 'true' вместо отключенного = ='инвалиды'.