Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Dec 2008
    Posts
    129
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Switiching between languages

    please i want to know if there is a possibility to force the user to type english characters
    coz i made all my web site in arabic and germany languages

    i want to force user to type the username and password in english characters

    any ideas?

  • #2
    Regular Coder
    Join Date
    Jan 2006
    Posts
    568
    Thanks
    6
    Thanked 84 Times in 84 Posts
    There may be a neater way, but you could just make a string containing all legal characters and check that each character of the username and password appears in the string.

    Assuming engChars is your string of all legal characters:

    Code:
    function checkEngChars(str) {
    	for(var i=0; i<str.length; i++) {
    		if(engChars.indexOf(str.charAt(i))==-1) {
    			return false;
    		}
    	}
    
    	return true;
    }


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •