Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Adobe Acrobat Dynamic Stamps with fillable fields

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #154615
    drizzy
    Participant

    Hi Everyone,

    I’m new to this java scripting code. What I’m trying to do in acrobat is create a dynamic stamp where the users inputs various data e.g company name / account number / approved by / date (generates today’s date) / pay bill (which would say”approved, N/A,)

    from searching the web I found some code here and there and I came up with this: but so far I’m having no luck. what am I doing wrong.

    I know this sites deals with more web related stuff, but I’m assuming since its Java Script it should be the same

    Thanks in advance

    var dialog = { companyValue: "", accountValue: "", approvedValue: "", payValue: "",
    
            commit:function (dialog) { // called when OK pressed 
                    var results = dialog.store();
                    this.companyValue = results["txt1"];
                    this.accountValue = results["txt2"];
                    this.approvedValue = results["txt3"];
                    this.payValue = results["txt4"];
            },      
    
            description:
            {       
                    name: "Account Information",    // Dialog box title
                    elements:
                    [       
                            {       
                                    type: "view", 
                                    elements:
                                    [       
                                            {       
                                                    name: "Company name: ",
                                                    type: "static_text",
                                            },      
                                            {       
                                                    item_id: "txt1", 
                                                    type: "edit_text",
                                                    multiline: true,
                                                    width: 300,
                                                    height: 30
                                            },  
                                            {       
                                                    name: "Account Number: ",
                                                    type: "static_text",
                                            },      
                                            {       
                                                    item_id: "txt2", 
                                                    type: "edit_text",
                                                    multiline: true,
                                                    width: 300,
                                                    height: 30
                                            },
                                            {       
                                                    name: "Approved By: ",
                                                    type: "static_text",
                                            },      
                                            {       
                                                    item_id: "txt3", 
                                                    type: "edit_text",
                                                    multiline: true,
                                                    width: 300,
                                                    height: 30
                                            }, 
                                            {       
                                                    name: "Pay Bill: ",
                                                    type: "static_text",
                                            },      
                                            {       
                                                    item_id: "txt4", 
                                                    type: "edit_text",
                                                    multiline: true,
                                                    width: 300,
                                                    height: 30
                                            }, 
                                            {       
                                                    type: "ok_cancel",
                                                    ok_name: "Ok",
                                                    cancel_name: "Cancel"
                                            },      
                                    ]       
                            },      
                    ]       
            }       
    
    
    };
    
    if(event.source.forReal && (event.source.stampName == "#Company_Stamp")) { if ("ok" == app.execDialog(dialog)) { var cMsg = dialog.companyValue; event.value = "Company\n" + cMsg; event.source.source.info.company = cMsg;
    
        cMsg = "Account\n" + dialog.accountValue;
        this.getField("AccountNumField").value = cMsg;
    
        cMsg = "Approved\n" + dialog.approvedValue;
        this.getField("ApproveByField").value = cMsg;
    
        cMsg = "Pay\n" + dialog.payValue;
        this.getField("PayBillField").value = cMsg;
    
    
    } }
    
    #154890
    drizzy
    Participant

    Thanks Mottie

    worth a shot

Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.