1 Reply Latest reply on Jun 10, 2010 1:47 PM by Srini Dhulipalla

    How to validate user input

    Bikas Tarway

      Hi,

       

      I am new to Form design

       

      I am designing an offline form I just want to validate the user input

      whether user has entered Character or Numric.

       

      if user enters characters in phone no I have to give an error message.

      can you please give the pice of the script to validate the user input.

       

      Regards

      Bikas

        • 1. Re: How to validate user input
          Srini Dhulipalla Level 5

          Instead of finding what is the type of input, you can restrict the user not to type characters in Phone No field.

          Place the below code in Change event of the Phone No field with Java Script as language.

           

           

           

          // restrict entry to digits
          if (xfa.event.change.match(/[0-9]/) == null)
               xfa.event.change = "";

           

          Note: You have placed the question in the wrong forum.. You might need the Designer ES forum.

           

          Thanks

          Srini