Components for Developers
© 2000-2012, Two Pilots

PDF Library Download Features Manual Tutorials FAQ Pricing HTML2PDF-X Pilot History In the Lab

PDF Creator Pilot documentation

Download CHM version of this manual.
Actions
PDFANNOTATION_OnChange

See Also Example
Collapse All

This property gets or sets a JavaScript action to be performed when a field value is changed. It allows the new value to be checked for validity.

Syntax

LONG PDFANNOTATION_OnChange { get; set; }
Value
Index of the action

Remarks

The index of the action can be retrieved from any action creating function such as CreateJavaScriptAction.

Equivalent in new interface: IPDFDocument4::OnControlChange.

Example

OnKeyPress Example

Delphi
[copy to clipboard]
{ PDF object is supposed to be created }
PDF.BeginDoc;

a1 := PDF.CreateJavascriptAction('this.getField("edit1").value = "changed!";');
a2 := PDF.CreateJavascriptAction('this.getField("edit2").value = "changed!";');

PDF.PDFPAGE_CreateControl_Edit('edit1', 10, 10, 60, 24);
PDF.PDFANNOTATION_Text := 'Edit1';
PDF.PDFANNOTATION_OnChange := a2;

PDF.PDFPAGE_CreateControl_Edit('edit2', 10, 30, 60, 44);
PDF.PDFANNOTATION_Text := 'Edit2';
PDF.PDFANNOTATION_OnChange := a1;

PDF.EndDoc;
C/C++
[copy to clipboard]
// PDF object is supposed to be created
PDF->BeginDoc();

LONG a1 = PDF->CreateJavascriptAction("this.getField('edit1').value = 'changed!';");
LONG a2 = PDF->CreateJavascriptAction("this.getField('edit2').value = 'changed!';");

PDF->PDFPAGE_CreateControl_Edit("edit1", 10, 10, 60, 24);
PDF->PDFANNOTATION_Text = "Edit1";
PDF->PDFANNOTATION_OnChange = a2;

PDF->PDFPAGE_CreateControl_Edit("edit2", 10, 30, 60, 44);
PDF->PDFANNOTATION_Text = "Edit2";
PDF->PDFANNOTATION_OnChange = a1;

PDF->EndDoc();
C#
[copy to clipboard]
// PDF object is supposed to be created
PDF.BeginDoc();

long a1 = PDF.CreateJavascriptAction("this.getField('edit1').value = 'changed!';");
long a2 = PDF.CreateJavascriptAction("this.getField('edit2').value = 'changed!';");

PDF.PDFPAGE_CreateControl_Edit("edit1", 10, 10, 60, 24);
PDF.PDFANNOTATION_Text = "Edit1";
PDF.PDFANNOTATION_OnChange = a2;

PDF.PDFPAGE_CreateControl_Edit("edit2", 10, 30, 60, 44);
PDF.PDFANNOTATION_Text = "Edit2";
PDF.PDFANNOTATION_OnChange = a1;

PDF.EndDoc();
Visual Basic
[copy to clipboard]
' PDF object is supposed to be created
PDF.BeginDoc

a1 = PDF.CreateJavascriptAction("this.getField('edit1').value = 'changed!';")
a2 = PDF.CreateJavascriptAction("this.getField('edit2').value = 'changed!';")

PDF.PDFPAGE_CreateControl_Edit "edit1", 10, 10, 60, 24
PDF.PDFANNOTATION_Text = "Edit1"
PDF.PDFANNOTATION_OnChange = a2

PDF.PDFPAGE_CreateControl_Edit "edit2", 10, 30, 60, 44
PDF.PDFANNOTATION_Text = "Edit2"
PDF.PDFANNOTATION_OnChange = a1

PDF.EndDoc

See Also

PDF Library Download Features Manual Tutorials FAQ Pricing HTML2PDF-X Pilot History In the Lab

 

 

PDF Library | Virtual Printer | Converters to PDF

Support | Blog | Forum | Contacts

© 2000-2012, Two Pilots