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

show dimensions

Participant ,
Mar 01, 2019 Mar 01, 2019

Copy link to clipboard

Copied

In this field I would like to type in, let's say, 33 and what I would like to show as a result would be, 3' x 3'. Or, if I enter any two digit number the field results would be in feet x feet. Figuring this out is a bit perplexing because I'm talking about a whole numbers and how would I break the number apart, put an x (for by) in between, and show the results in the same field. And, notice the spacing of the results. I have this script and was playing around with it. I got it to put the ' marks in the results. I have to type in the number like this - 3.3. The result is 3'3'. It's close but no cigar. Is it possible to have the field return the results the way I want?

Here's the javascript I'm playing around with:

event.value=this.getField("Footings1").value.toFixed(2).replace(".","' ").replace(/.$/,"' ");

TOPICS
Acrobat SDK and JavaScript , Windows

Views

412

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 , Mar 02, 2019 Mar 02, 2019

Yes. You can do it using this custom validation script:

if (event.value.length==2) event.value = event.value.charAt(0) + "' x " + event.value.charAt(1) + "'";

Votes

Translate

Translate
Community Expert ,
Mar 02, 2019 Mar 02, 2019

Copy link to clipboard

Copied

Yes. You can do it using this custom validation script:

if (event.value.length==2) event.value = event.value.charAt(0) + "' x " + event.value.charAt(1) + "'";

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
Participant ,
Mar 02, 2019 Mar 02, 2019

Copy link to clipboard

Copied

LATEST

thanks again. Very, very nice.

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