Skip to main content
Inspiring
May 26, 2023
Answered

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

  • May 26, 2023
  • 1 reply
  • 1073 views

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.

This topic has been closed for replies.
Correct answer try67

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.");

1 reply

Eric Dumas
Community Expert
Community Expert
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

 

RAFAZAAuthor
Inspiring
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

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
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.");