Here you go. Put this in the validate event for your field. It will strip out any characters other than 0123456789xX and then check that the result has 13 characters.
validateISBN(this.rawValue);
function validateISBN(s) {
var rExp = /[^0123456789xX]/gi;
var strFilteredString = s.replace(rExp, "");
this.rawValue = strFilteredString;
return (strFilteredString.length == 13)
}
Jared Langdon
www.jlangdon.ca