Thanks for the update,
I tried to simplyfy things with the following code but no luck, we basically want to accept any postcode that includes the first 3 characters, if anyone has a quick fix for this, it would be greatly appreciated!
<script>
const field = document.getElementById('input')
const form = document.getElementById('checkout-form')
const button = document.getElementById('submit')
field.value = 'input'
field.addEventListener('input', function() {
if (field.value.includes('EC1A', 'EC1M', 'EC1N', 'EC1P', 'EC1R', 'EC1V', 'EC1Y', 'EC2A', 'EC2M', 'EC2N', 'EC2P', 'EC2R', 'EC2V', 'EC2Y', 'EC3A', 'EC3M', 'EC3N', 'EC3P', 'EC3R', 'EC3V', 'EC4A', 'EC4M', 'EC4N', 'EC4P', 'EC4R', 'EC4V', 'EC4Y', 'EC50', 'N1', 'N15', 'N19', 'N1C', 'N1P', 'N4', 'N5', 'N6', 'N7', 'NW1', 'NW1W', 'NW26', 'NW3', 'NW5', 'NW6', 'NW8', 'W1', 'W1A', 'W1B', 'W1C', 'W1D', 'W1F', 'W1G', 'W1H', 'W1J', 'W1K', 'W1M', 'W1N', 'W1P', 'W1R', 'W1S', 'W1T', 'W1U', 'W1V', 'W1W', 'W1Y', 'W3', 'WC1A', 'WC1B', 'WC1E', 'WC1H', 'WC1N', 'WC1R', 'WC1V', 'WC1X', 'WC2A', 'WC2B', 'WC2E', 'WC2H', 'WC2N', 'WC2R', 'WC99'
)) {
message.style.display = "none"
button.style.backgroundColor = "green"
button.style.color = "white"
button.disabled = false
} else {
message.style.display = "block"
message.innerHTML = "Sorry we're not currently delivering to your location."
button.style.backgroundColor = "gray"
button.disabled = true
button.style.color = "darkgray"
}
})
</script>