﻿ //You will need to include KeyboardFilterCommonCode on your page for this to work.
 //<!--
function AddressFilter (event)
{   
    try
        {
        var rv ; 
        var keyAscii = GetKeyAscii (event) ;

        if (IsCommonAscii(keyAscii) ) 
            {rv= true;}
        else    
            {  
                switch (true)
                    {                   
                        case (keyAscii==190 || keyAscii==32 || keyAscii==192 || keyAscii==189 || keyAscii==189 || keyAscii==191 || keyAscii==220):
                            // apostrophe, space, full stop ,hyphen, hyphen on numberpad, left and right slashes
                            rv=true ;
                        break;
                        
                        case (keyAscii >64 && keyAscii<91):
                            //Letters of the alphabet
                            rv=true ;
                        break;   
                        
                        case (keyAscii >47 && keyAscii<58):
                             // Numbers
                            rv=true ;
                        break; 
                        
                        case (keyAscii >95 && keyAscii<106):
                             // Numbers on numeric pad
                            rv=true ;
                        break;        
                        
                        default:
                           //{alert(keyAscii);}
                            rv=false ;
                    }
                return rv;
            }
        }
    catch (ex)
        { }
}
//-->
