#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2014
    Posts
    4
    Rep Power
    0

    Exclamation Email veryfiaction - Exclusion of Polish characters


    Hi lads, i have problem with email veryfiaction.
    I need to make exclusion of Polish characters,like: (śłżźćńęą)

    Anyone can help ?

    Code:
        // Validate email
            function validateEmail(email){
            var re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
            if(re.test(email)){
        document.getElementById('email').style.background ='#ccffcc';
        document.getElementById('emailError').style.display = "none";
        return true;
            }else{
        document.getElementById('email').style.background ='#ffc3c3';
        return false;
              }
            }
             function validateCheckbox(terms){
          if(document.getElementById(terms).checked){
            return true;
          }
          return false;
        }
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2013
    Posts
    67
    Rep Power
    0
    Do you need to actually remove them, or is they end up encoded properly on the server is that ok too?
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2014
    Posts
    4
    Rep Power
    0
    I just need to validate input and send info to user that email is wrong and contains illegal characters.

    I have function that check input and give green or red color immediately after enter of value to the input field.
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2013
    Posts
    67
    Rep Power
    0
    I found this somewhere else.

    Uppercase and lowercase English letters (a-z, A-Z)
    Digits 0 to 9
    Characters ! # $ % & ' * + - / = ? ^ _ ` { | } ~
    Character . (dot, period, full stop) provided that it is not the first or last character, and provided also that it does not appear two or more times consecutively.

    You would want to remove anything that isn't one of those. So instead dealing with polish characters specifically, maybe just go for anything that isn't the above.

    Also, have you tried using a 3rd party solution, such as jquery? Jquery or jquery UI has built in form validation functionality.

    Comments on this post

    • web_loone08 agrees : @syngressco: Use a JavaScript "Regular Expression" and the JavaScript Global "replace() API" with the above characters. Do an online search for those terms, for more information about them.

IMN logo majestic logo threadwatch logo seochat tools logo