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

Showing/Hiding Signatures Based on Ranges

New Here ,
May 14, 2019 May 14, 2019

Copy link to clipboard

Copied

Hi - I'm struggling a bit with a simple field validation issue. Based off of one field (called "NUMBER") I would like the following to appear (and the rest to disappear if not applicable) within the following ranges:

  • 0-499,999 would trigger "Field 1"
  • 500,000-2,499,999 would trigger "Signature Block A"
  • 2,500,000-5,000,000 would trigger "Signature Block B"
  • 5,000,001+ would trigger "Field 2"

I can also post the custom Java script if that helps but I have no luck with this custom code as of yet.  Any help would be greatly appreciated. Thanks!

TOPICS
Acrobat SDK and JavaScript , Windows

Views

744

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 , May 14, 2019 May 14, 2019

Yes, I don't think you need to use Adobe Sign to do it. It's perfectly feasible in a normal Acrobat form, and probably easier.

You can use this code to achieve it, as the custom validation script of the NUMBER field:

var v = Number(event.value);

this.getField("Field 1").display = (v>=0 && v<=499999) ? display.visible : display.hidden;

this.getField("Signature Block A").display = (v>=500000 && v<=2499999) ? display.visible : display.hidden;

this.getField("Signature Block B").display = (v>=2500000 && v

...

Votes

Translate

Translate
Community Expert ,
May 14, 2019 May 14, 2019

Copy link to clipboard

Copied

Is this a Adobe Sign Form?

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
New Here ,
May 14, 2019 May 14, 2019

Copy link to clipboard

Copied

No - should I convert it to an Adobe Sign Form?

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 ,
May 14, 2019 May 14, 2019

Copy link to clipboard

Copied

What does you mean with "Signature Blocks"? This exists only in Adobe Sign forms.

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
New Here ,
May 14, 2019 May 14, 2019

Copy link to clipboard

Copied

I was still able to add a digital signature to an Acrobat Form, though I'm not familiar with the differences.

Once converted to an Adobe Sign Form, how can I go about this issue?

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 ,
May 14, 2019 May 14, 2019

Copy link to clipboard

Copied

For Adobe Sign forms use the forum for Adobe Sign.

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
New Here ,
May 14, 2019 May 14, 2019

Copy link to clipboard

Copied

Well I would still like it to be a digital signature, and that does not seem to be what I am looking for.

In an adobe acrobat form, how would I do this making reference to the above field names?

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
New Here ,
May 14, 2019 May 14, 2019

Copy link to clipboard

Copied

Any help would be greatly appreciated if the form were to stay in Acrobat Form (as opposed to a sign form)!

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 ,
May 14, 2019 May 14, 2019

Copy link to clipboard

Copied

Yes, I don't think you need to use Adobe Sign to do it. It's perfectly feasible in a normal Acrobat form, and probably easier.

You can use this code to achieve it, as the custom validation script of the NUMBER field:

var v = Number(event.value);

this.getField("Field 1").display = (v>=0 && v<=499999) ? display.visible : display.hidden;

this.getField("Signature Block A").display = (v>=500000 && v<=2499999) ? display.visible : display.hidden;

this.getField("Signature Block B").display = (v>=2500000 && v<=5000000) ? display.visible : display.hidden;

this.getField("Field 2").display = (v>5000000) ? display.visible : display.hidden;

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
New Here ,
May 14, 2019 May 14, 2019

Copy link to clipboard

Copied

Thanks for the help, Try67. That still doesn't seem to be effective....

Also, Why does Number not have quotations on the first line?

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 ,
May 14, 2019 May 14, 2019

Copy link to clipboard

Copied

Check the JS Console for errors, then.

It doesn't have quotes because it's not a reference to the field, but a call to the constructor method of the Number object in JavaScript, which is basically converting the string value to a number value.

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
New Here ,
May 14, 2019 May 14, 2019

Copy link to clipboard

Copied

The debugger says that Number is not defined. Any thoughts here?

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 ,
May 14, 2019 May 14, 2019

Copy link to clipboard

Copied

Did you change anything in the code?

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
New Here ,
May 14, 2019 May 14, 2019

Copy link to clipboard

Copied

No but I do have a checkbox that show/hide the Number field (along with others). It now seems to break at the number field.

Debugger says it is null.

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 ,
May 14, 2019 May 14, 2019

Copy link to clipboard

Copied

There's no reference in the code to a field called "Number". If you didn't change anything and the field names are correct then it should work. I'll need to see the actual file to help you further.

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
New Here ,
May 14, 2019 May 14, 2019

Copy link to clipboard

Copied

Thanks Try67! I got it to work! One last item - if the value of Number is null, I want nothing to show - how would I add that in?

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 ,
May 14, 2019 May 14, 2019

Copy link to clipboard

Copied

That's a bit trickier... Change the code to this:

if (event.value=="") {

     this.getField("Field 1").display = display.hidden;

     this.getField("Field 2").display = display.hidden;

     // etc.

} else {

     // put the original code here

}

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
New Here ,
May 15, 2019 May 15, 2019

Copy link to clipboard

Copied

LATEST

Great, thanks for all the help!

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