2017-09-01 8 views
0

eacbページに人名のあるページが多数あるpdfファイルを作成しています。私は、すべてのフィールドでラベルを同じ名前にして、pdf全体の名前を簡単に自動化しました。PDF元の入力に影響を与えずに、自動入力フィールドに異なる値を切り替えます。

クライアントは機能が、それは例えば、すべてのフィールドを変更しますので、今、私は(それが最初にあなたの名前を尋ねられたとき)最初のほかのページに名前を変更しようとすると、文書全体の名前を変更したいです

Table of what I need accomplished

私は、各フィールドに簡単なJavaScriptを実行していることを考えていた:私は、スクリプトのスコープの思考になった

this.getField("Date") = event.value || event.value = event.value; 

。私はプロパティのアクションタブで作業しています。本当に変数を設定する必要がありますか?だから私はした:

var name000 = this.getField( "Name"); name000 == event.value || event.value == event.value;

次に、ドキュメント全体を調べて、すべてのフィールド名を一意に変更しました。 Dateの代わりに、Name00、Name01、Name02、Name03など、すべての方法でName24まで。最初のいくつかのラベルに使用

this.getField("Date").value = this.getField("Date00").value; 
this.getField("Date").value = this.getField("Date01").value; 
this.getField("Date").value = this.getField("Date02").value; 

このシナリオでの問題は、フィールドが、私は何もしていないような空ですDate00後です。同じように変数を追加しました。

this.getField("Name") = event; 
// set value of field "Name" to this field's value; 
this.getField("Name00").value = event.value; 
// end on blur action for field Date; 


var Name1 = this.getField("Name"); 
var Name2 = this.getField("Name01"); 
Name2.value = Name1.value; 
// end on blur action for field Date; 

var Name1 = this.getField("Name"); 
var Name3 = this.getField("Name02"); 
Name3.value = Name1.value; 

Third label is blank, so I assigned unique variables named the Name Field differently and still blank after I assign more than one field. 

var name000 = this.getField("Date"); 
name000 == event.value || event.value == event.value; <-- This has the same problem. 

9/2更新。

this.getField( "Name")= event.value || event.value = event.value; Onblur Javascriptのエラー "SyntaxError:左辺に無効な割り当てがあります。"このエラーだけでは、すべてのフィールド名「名前」を修正するためにフォーム全体を調べることは望ましくありません。 Name24

まで 名、Name01、Name02、03,10、それに加えて、すべてのフィールドのコピーに時間がかかるトーゴのようだ:それらは、異なるIを命名した

this.getField("Name") = event.value || event.value = event.value; 
this.getField("Name00") = event.value || event.value = event.value; 
this.getField("Name01") = event.value || event.value = event.value; 
this.getField("Name02") = event.value || event.value = event.value; 
this.getField("Name03") = event.value || event.value = event.value; 
      " \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\" 
this.getField("Name24") = event.value || event.value = event.value; 

それはとにかく計算しません。

は、より多くの自動化と少ないコードのためのOOPスクリプトをしようとします:

var i f fi nv; 
function n(f){ 
    return n > 9 ? "" + n: "0" + n; 
} 

f = this.getField(“Name") = event.value; 

fi = this.getField("'Name' + i") = event.value; 

nv = event.value = event.value; 

while (i = 0; i < i++) { 
return i <= 24; 
}; 

f fi || nv; 

は、私が行方不明、しかしエラーが出ます「;」 2行目?

ブログから、私は彼らがタスクを完了するための最初のフィールドだけに1つのスクリプトを使用していることに気付きました。 PDFメインのJavascriptメタデータを使用して、同じフィールドをすべて更新することはできますか?誰もこれをしましたか? これを解決するには簡単な方法がありますか、とにかくですか?私はこれにあまりにも多くの時間を費やしてきた。

+0

私はこの挑戦に取り組んできた私は、それを理解することはできません。私は以前のバージョンのAcrobat Xの例があるこのブログ投稿を見つけましたが、JavaScriptのロジックはそこにあります.---> https://blogs.uoregon.edu/developments/2010/07/14/use-data-from- 1つのフィールドから複数のフィールドへの他のフィールドのアクロバット記入フォーム/ – Tryah85

答えて

0

私は、各フィールドは一意である必要があり、主を除くすべてのフィールドは、フィールドのプロパティで[アクション]タブでONBLURを実行するにはJavaScriptが必要であることを発見したさらなる調査:

//Set the source and destination vars: 
     var source = this.getField("ClientName"); 
     var destination = this.getField("CN2"); 

//See if destination is empty and if so, insert source value 
     if(destination.value==''||destination.value==null){destination.value=source.value} 
関連する問題