2017-03-22 7 views
0

こんにちは皆私はあらゆる種類の場所を見てきましたが、私がしようとしていることを理解できませんでした。 "Attention To:"テキストを置き換えるオプションがあります。ここで私はAdob​​e AcrobatでのデフォルトのテキストJavascript Stamp

var dialog = { 
    AtttoValue: "", 
    LSDValue: "", 
    AFEValue: "", 
    MOCValue:"", 
    AcccodeValue:"", 
    PrintValue:"", 

    commit:function (dialog) { /// called when OK pressed 
      var results = dialog.store(); 
      this.AtttoValue = results["txt1"]; 
      this.LSDValue = results["txt2"]; 
      this.AFEValue = results["txt3"]; 
      this.MOCValue = results["txt4"]; 
      this.AcccodeValue = results["txt5"]; 
      this.PrintValue = results["txt6"]; 
    },  

    description: 
    {  
      name: "stamp Information", // Dialog box title 
      elements: 
      [  
        {  
          type: "view", 
          elements: 
          [  
            {  
              name: "Attention To:", 
              type: "static_text", 
            },  
            {  
              item_id: "txt1", 
              type: "edit_text", 
              multiline: true, 
              width: 200, 
              height: 20 
            }, 
            {  
              name: "Enter LSD:", 
              type: "static_text", 
            },  
            {  
              item_id: "txt2", 
              type: "edit_text", 
              multiline: true, 
              width: 200, 
              height: 20 
            },  
            {  
              name: "Enter AFE/Cost Code:", 
              type: "static_text", 
            },  
            {  
              item_id: "txt3", 
              type: "edit_text", 
              multiline: true, 
              width: 200, 
              height: 20 
            }, 
            {  
              name: "Enter MOC#:", 
              type: "static_text", 
            },  
            {  
              item_id: "txt4", 
              type: "edit_text", 
              multiline: true, 
              width: 200, 
              height: 20 
            }, 
            {  
              name: "Enter Account Code:", 
              type: "static_text", 
            },  
            {  
              item_id: "txt5", 
              type: "edit_text", 
              multiline: true, 
              width: 200, 
              height: 20 
            }, 
            {  
              name: "Print Name:", 
              type: "static_text", 
            },  
             {  
              item_id: "txt6", 
              type: "edit_text", 
              multiline: true, 
              width: 200, 
              height: 20 
            }, 
            {  
              type: "ok_cancel", 
              ok_name: "Ok", 
              cancel_name: "Cancel" 
            },  
          ]  
        },  
      ]  
    }  
}; 

if(event.source.forReal && (event.source.stampName ==   "#C6nQNxSFN0d4NCJMeJuYYA")) 
{ 
if ("ok" == app.execDialog(dialog)) 
{ 
;var cMsg = dialog.AtttoValue; 
;event.value = "\n" + cMsg; 
;event.source.source.info.afe = cMsg; 

this.getField("LSD").value = "\n" + dialog.LSDValue; 

this.getField("AFE").value = "\n" + dialog.AFEValue; 

this.getField("MOC").value = "\n" + dialog.MOCValue; 

this.getField("Acccode").value = "\n" + dialog.AcccodeValue;  

this.getField("Print").value = "\n" + dialog.PrintValue; 


    } 

}

を持っているコードは、おかげで任意の助けが大幅にあなたはダイアログオブジェクトに初期化オブジェクトを追加する必要が

答えて

0

をいただければ幸いです。このようなもの... "txt1"としたいフィールドがあると仮定します。

{ 
    initialize: function(dialog) { 
     dialog.load({"txt1": "yourDefaultValue" }); 
    } 
} 
関連する問題