function isNumeric(pccharinput) { // 1) this allows the numbers 0-9 return(pccharinput>="0" && pccharinput<="9") } function isQty(pccharinput) { return (pccharinput=="-" || pccharinput=="-1" || pccharinput=="-2" || pccharinput=="-3" || pccharinput=="-4" || pccharinput=="-5" || pccharinput=="-6" || pccharinput=="-7" || pccharinput=="-8" || pccharinput=="-9" ) } function isAlphabetic(pccharinput) { // 2) this allows the letters A-Z & a-z return((pccharinput>="A" && pccharinput<="Z") || (pccharinput>="a" && pccharinput<="z")) } function isAlphaNumeric(pccharinput) { // 3) this allows 1) & 2) from above to be put together return (isAlphabetic(pccharinput) || isNumeric(pccharinput)) } function isEmpty(pccharinput) { // checks for any empty fields in the HTML form if (pccharinput=="" || pccharinput==" ") return true; else return false; } function isAddressChar(pccharInput) { // allows numbers, alphabets and the special name characters from line 34. if (isAlphaNumeric(pccharInput) || isNameSpecialChar(pccharInput)) return true else return false } function isNameChar(pccharinput) { // this is all the alphabet and the special characters for the name return (isAlphabetic(pccharinput) || isNameSpecialChar(pccharinput)) } //alert(isNameChar("michelle'hgf")) function isNameSpecialChar(pccharinput) { // these are the special characters allowed for the name return (pccharinput=="'" || pccharinput=="-" || pccharinput==" ") } /////////////////////////////////////////////////////////////////////// function isTelephoneSpecialChar(pccharinput) { // 4) these are the special characters allowed for the telephone return (pccharinput=="(" || pccharinput==")" || pccharinput=="-" || pccharinput=="+" || pccharinput=="x" || pccharinput=="e" || pccharinput==" " || pccharinput=="t") } function isTelephoneChar(pccharinput) { // this allows numbers and the special characters to be in the telephone field. if (isNumeric(pccharinput) || isTelephoneSpecialChar(pccharinput)) return true else return false } function isTelephoneString(pcstrInput) { // this disallows all the letters below in that sequence. var w, lvintdashpos, lvintTXE, lvintTEX, lvintETX, lvintXET, lvintXTE, lvintEXT, lvintBracket lvintdashpos=pcstrInput.indexOf("-") lvintTXE=pcstrInput.indexOf("txe") lvintTEX=pcstrInput.indexOf("tex") lvintETX=pcstrInput.indexOf("etx") lvintXET=pcstrInput.indexOf("xet") lvintXTE=pcstrInput.indexOf("xte") lvintBracket=pcstrInput.indexOf("()") lvintEXT=pcstrInput.indexOf("ext") for (w=0; w