Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author xnau webdesign

    (@xnau)

    Em,

    There is no “post processing” of values entered in the plugin. The best you can do is to take spaces out of the validation and tell your users not to put spaces into the phone number.

    If you wanted to add some Javascript to the page, it could be done that way.

    Thread Starter bw3em

    (@bw3em)

    So how do I take spaces out of the validation?
    #[0-9- ]{7,14}# is gobbledegook to me! ??

    Another option is to limit the chars to 11 (a normal UK mobile) – how would I do that please?

    Plugin Author xnau webdesign

    (@xnau)

    Fair question…regex codes are pretty arcane! The code for validating a phone number is a very simple example, though. The characters in the square brackets define the set of acceptable characters. So, we just remove the space from that set. The curly brackets define the range of numbers of characters that are acceptable {7,14} means that a minimum of 7 and a maximum of 14 is acceptable. So the regex you are requesting would look like this:

    #[0-9-]{11}#

    That would be for exactly 11 characters, numbers 0 through 9 and hyphen. (the hyphen between the numbers indicates a range) It’s good idea to explain to people exactly what you’re looking for to help them get it right.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Validation query’ is closed to new replies.