I have code on my site that validates user inputs on a form, and gives an error message of they enter any non-alphabetic character.
My problem is that if they live in a suburb with 2 words (eg "st kilda") it will detect the space as a non-alphabetic character an return an error message. How can I edit the following code to ignore the space??
if (!isAlphabetic(document.getElementById("Suburb").value))
{
alert("Please enter suburb properly");
document.gbook.Suburb.focus();
return false;
}
function isAlphabetic(val)
{
if (val.match(/^[a-zA-Z]+$/))
{
return true;
}
else
{
return false;
}


