Try this..
This is the javascript that i have used and its working.Try with this
function checkregex() {
if (!form1.TextBox1.value.match(/^[a-zA-Z ]+$/) && form1.TextBox1.value != "") {
form1.TextBox1.value = "";
form1.TextBox1.focus();
alert("Please Enter only alphabets in text");
}
}
here is the regexx to validate one or 2 words with a whitespace between them
(/^[a-zA-Z0-9]+ ?([a-zA-Z0-9]+$){1}/)
Note : you cannot have a whitespace at the end if it is only one word
Try and let me know u got it or not