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

How to create a text only format on text box

New Here ,
Oct 06, 2022 Oct 06, 2022

I've created a fillable form and i'd like to create a text only textbox.

For instance, it's possible to create a date-specific text box, I'd like to do the same but only for text only and no other characters.

 

Please advise? 

TOPICS
PDF forms
1.3K
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 ,
Oct 06, 2022 Oct 06, 2022

Did you test this code? Because it doesn't work... Instead, use this as the field's custom Keystroke script:

 

event.rc = /^[a-z]*$/i.test(event.change);

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 ,
Oct 06, 2022 Oct 06, 2022

Hi,

 

You can do that on the validate of the field something like this

// event.rc = return true to let the value stay in the field, false to revert
// event.value.match = test the string against a Regex, returns true or false
// "[A-z]" - regex that allows all capital and lower case letters.
event.rc = event.value.match("[A-z]");

 

BarlaeDC_0-1665045226098.pngexpand image

 

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 ,
Oct 06, 2022 Oct 06, 2022

Did you test this code? Because it doesn't work... Instead, use this as the field's custom Keystroke script:

 

event.rc = /^[a-z]*$/i.test(event.change);

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 ,
Oct 06, 2022 Oct 06, 2022

yes and it worked, although I had more than one text field, as the field has to loose focus for the code to run,

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 ,
Oct 06, 2022 Oct 06, 2022

This file is empty, and when I used that code myself I was able to enter numbers into the text field. See attached.

 

 

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 ,
Oct 06, 2022 Oct 06, 2022
LATEST

HI,

 

yes, but when you exit it resets to the previous text,  your answer is better.

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 ,
Oct 06, 2022 Oct 06, 2022

I can't see any form field in the document?

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