We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 25979
    • 178 Posts
    Hi all,

    trying to get eForm to do what is should do, but...

    I have in my form template:

    <input id="Name" class="kontakt_form" name="Name" value="Twoje imię i nazwisko" onblur="if(this.value=='') this.value='Twoje imię i nazwisko';" onfocus="if(this.value=='Twoje imię i nazwisko') this.value='';" type="text"  eform="Twoje imię i nazwisko::1:Wypadałoby podać co najmniej dwa słowa:#REGEX /^\w+\s\w+/i"/></label>


    Validation checks whether there are two words and it works great until I am trying to submit in that field some polish characters, like: łęśćążź. When any of them is found in that input I get an error. When I remove it everything works fine.

    Any ideas folks?

    Regards,

    Mike
      //Why use windows since there is a door?//
      • 30223
      • 1,010 Posts
      eForm uses preg_match to do the regular exprssion matching. Here’s why it doesn’t work for you (from the php manual).

      ...PCRE has to search a structure that contains data for over fifteen thousand characters (when parsing UTF8 - ed.) . That is why traditional escape sequences such as \d and \w do not use Unicode properties in PCRE

      So your regular expression doesn’t support utf8 characters. There are a few PCRE escape sequences and a modifier that do however. See http://www.php.net/manual/en/regexp.reference.php

      Possible solution:
      Try this pattern and see if it works for you.

      /^\p{L}+\s\p{L}+/iu


      (if not read all about patterns at the link above and experiment... this is as far as my expertise with regular expressions goes )
        • 25979
        • 178 Posts
        yeap that works great!

        Thanks a lot!

        Regards,

        Mike
          //Why use windows since there is a door?//
          • 30223
          • 1,010 Posts
          Glad I could help..