We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 25422
    • 11 Posts
    I have an registration form[firstname,phone number,email etc] in my site,I need to validate it,

    The validation is working but it doesn’t check whether it is integer or not,or string or not

    Its quite urgent for me to get this done

    Kindly help me on this at the early as possible



    Note:I am working with eform
      • 4310
      • 2,310 Posts
      For basic telephone number validation try :
      eform="Telephone::1:Use only numbers, hyphens and spaces:#REGEX /^([0-9]*\-?\ ?\/?[0-9]*\-?\ ?\/?[0-9]*)$/" 

      IIRC this allows for upto three groups of numbers optionally separated by spaces or hyphens.
        • 25422
        • 11 Posts
        Thanks for your response,..
          • 36549
          • 572 Posts
          Hi,

          where is the above code added please?

          thanks for any help
            www.9thwave.co.uk
               WEB | DESIGN | PRINT
          • Add it as an attribute to the form’s input field:
            <input type="text" name="phone" id="phone" eform="Telephone::1:Use only numbers, hyphens and spaces:#REGEX /^([0-9]*\-?\ ?\/?[0-9]*\-?\ ?\/?[0-9]*)$/" />
              Studying MODX in the desert - http://sottwell.com
              Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
              Join the Slack Community - http://modx.org