Page 1 of 1

jAVASCRIPT and properties

Posted: Sun Sep 08, 2019 5:47 pm
by countryside_01
Hello all,

I an currently trying my first javascript issues to improve some of my forms.
I found several ideas here, thanks !

We are currently trying to get a forms which will be sent to customers to review some addresses, mails phones and other stuff.
The idea, is :
  1. we send an pdf to the customer with the information we get already filled from our CRM (ok)
  2. the guy is validating the parameters
  3. should he want to change one, we ask him to check a box which will unprotect the fields. Is there a way to create a function which unprotects a field ?
  4. he will then update what is needed.
  5. and return it to our attention.
But when he changes a field, we would like to change the background color of the field, to make our assistants' life easier !
Any idea ?
By the way, is there a link to the events and forms parameters I can use (as you guess I am NOT a javascript expert !!)

Thanks by advance for your help,

All the best,
Franck

Re: jAVASCRIPT and properties

Posted: Mon Sep 09, 2019 3:27 pm
by Paul - Tracker Supp
Hi Franck,

If I understand your needs correctly, you want to be able to toggle the "lock" state of form fields and believe it should be possible.
Take a look at the JavaScript API from Adobe, we adhere to it, and this should give you all the resources you need:
https://www.adobe.com/content/dam/acom/ ... erence.pdf

Do let us know if you have specifics questions around implementing that after going through that document.

regards

Re: jAVASCRIPT and properties

Posted: Tue Sep 10, 2019 4:56 pm
by countryside_01
Hi Paul,

thank you for your help !
So, it is almost done, but .....
1. When opening document , i reset all fillColor to transparent, OK :)
2. When the customer says ' ii want to moddify the informatons', I unprotect several fields, ok. :)
3. When a field is modified , I set the javascript option , which set the fillColor to red. OK :)

But.... IS there a way to create such script as a kind of 'function' (because it will be basically the same for all the fields) :?:
AND... Is there a way to set all my fields to that globally ? :|

AND, last but not least... The PDF Form is almost completed, We will draw some lines , boxes... to get it nicer , and suddenly it seems that PDFXchange does not appreciate drawing lines adn other stuff too much !

Any idea ?

Best regards,
 

Re: jAVASCRIPT and properties

Posted: Tue Sep 10, 2019 7:32 pm
by TrackerSupp-Daniel
Hello Countryside_01,

You can turn any JS into a UI button to be initiated with a click by following this KB: https://www.pdf-xchange.com/knowle ... the-Editor

Regarding affecting all fields globally, you should be able to use a "catch all" string in the JS, so that it will affect all fields at the same time.

Regarding your final issue with drawing lines. Can you please provide more details on what you mean by "it does not appreciate drawing lines and other stuff too much" ? Does the application freeze or crash, do you find it running more slowly than usual, also, how many content items, like these lines, already exist on the page? If possible, please send a sample document so we can attempt to reproduce this issue.

Kind regards,