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

How to create a text only format on text box

New Here ,
Oct 06, 2022 Oct 06, 2022

Copy link to clipboard

Copied

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

Views

1.1K

Translate

Translate

Report

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

correct answers 1 Correct answer

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

Votes

Translate

Translate
Community Expert ,
Oct 06, 2022 Oct 06, 2022

Copy link to clipboard

Copied

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.png

 

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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

 

 

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

LATEST

HI,

 

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

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

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