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

Showing/Hiding Signatures Based on Ranges

New Here ,
May 14, 2019 May 14, 2019

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

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

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

Is this a Adobe Sign Form?

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

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

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

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

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

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?

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

For Adobe Sign forms use the forum for Adobe Sign.

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

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?

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

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

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 ,
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<=5000000) ? display.visible : display.hidden;

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

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

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

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

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

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.

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

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

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

Did you change anything in the code?

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

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.

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

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.

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

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?

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

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

}

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

Great, thanks for all the help!

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