Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

como se puede validar en un campo de texto de un formulario que no permita introducir espacio y -

Community Beginner ,
May 26, 2023 May 26, 2023

Hola.

Necesito validar en un campo de texto de un formulario que no permita introducir ni espacios ni - u otros caracteres especiales. Solo letras y números sin separarlos.

TOPICS
How to , JavaScript , PDF forms
1.0K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
1 ACCEPTED SOLUTION
Community Expert ,
May 26, 2023 May 26, 2023

You can use something like this as the field's custom Keystroke script:

 

event.rc = /^[a-z\d]*$/i.test(event.change);
if (!event.rc) app.alert("You may only enter letters and numbers in this field.");

View solution in original post

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 26, 2023 May 26, 2023

You can check in the properties of the field, In the validate tab, you can add a script to verify input.

Look at Solved: How to Format text field to alpha only - Adobe Support Community - 9520642

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
May 26, 2023 May 26, 2023

Thank you but it didn't work. I need to validate de text in a adobe acrobat form field and when you use a " " or "-" it must give an error. I used de field format "OOOOOO" but it give a general error and I want to have my own text of error

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 26, 2023 May 26, 2023

You can use something like this as the field's custom Keystroke script:

 

event.rc = /^[a-z\d]*$/i.test(event.change);
if (!event.rc) app.alert("You may only enter letters and numbers in this field.");
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
May 26, 2023 May 26, 2023
LATEST

Perfect!!! Thank you

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines