Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.

How to validate user input

Avatar

Level 1

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 Reply

Avatar

Level 10

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