detecting change to a form field

PDF-XChange Viewer SDK for Developer's
(ActiveX and Simple DLL Versions)

Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange

joeitaliano
User
Posts: 89
Joined: Wed Dec 29, 2010 8:50 am

detecting change to a form field

Post by joeitaliano »

hello

i have a PDF file opened that has several tick boxes

what i want to do is to insert/remove a page(s) depending on the state of that tick box

is there any way to detect a change to a form field returning information about what has changed

many thanks
User avatar
Stefan - PDF-XChange
Site Admin
Posts: 19913
Joined: Mon Jan 12, 2009 8:07 am

Re: detecting change to a form field

Post by Stefan - PDF-XChange »

Hello Joe,

You will need to have a script that listens for events for the particular field (that check box), and when an event is fired - use the isBoxChecked method, but I am not quite sure whether this is currently supported in our SDK - so I have asked for some help from the dev team.

Cheers,
Stefan
User avatar
Vasyl - PDF-XChange
Site Admin
Posts: 2448
Joined: Thu Jun 30, 2005 4:11 pm

Re: detecting change to a form field

Post by Vasyl - PDF-XChange »

Hi, joe.

In the new build(upcoming) you will be able to intercept the new event:

Code: Select all

eventhandler OnEvent(type, name,....)
{
    if ((type == PXCVA_OnNamedNotify) AND (name == "Notifications.FieldChanged"))
    {
        string fn; 
        ctrl.GetProperty("Notifications.FieldChanged.Name", fn, 0);
        string js = "var f = this.getField(" + fn + "); if (f != null) { f.value; };";
        string newVal; 
        ctrl.RunJavaScript(js, out newVal, ...);
        ....
    }
}
Wait for the new build and look to the updated SDK help, [Reference/NamedItems/Objects/Notifications/FieldChanged].

Best
Regards.
PDF-XChange Co. LTD (Project Developer)

Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
joeitaliano
User
Posts: 89
Joined: Wed Dec 29, 2010 8:50 am

Re: detecting change to a form field

Post by joeitaliano »

fantastic cant wait to get my hands on it

thanks
User avatar
Paul - PDF-XChange
Site Admin
Posts: 7370
Joined: Wed Mar 25, 2009 10:37 pm

Re: detecting change to a form field

Post by Paul - PDF-XChange »

HI Joe,

look for it mid January.

:-)
Best regards

Paul O'Rorke
PDF-XChange Support
http://www.pdf-xchange.com