Skip to main content
Oct 14, 2022 2:14 AM UTC
Question

Dynamic Stamp - Setting Dialog Box Defaults

I found how to set the defaults in a stamp dialog box for text boxes, dropdown boxes, and check boxes, but I cannot find out how to set a default for a radio box.

 

For instance, in the code block below, it's easy to see how the textboxes and dropdown list will have their defaults set. But I have no idea how to do it for the radio boxes. Does anybody know the syntax for this?

var builder = {
    // These map to Text Fields in the Stamp
    textBoxes: [
        { field: "Name", description: "Name:", default: function() { return ""; } },
        { field: "Company Name", description: "Company Name:", default: function() { return ""; } },
    ],
    // This maps to a Popup Group in the PDF named 'Project'
    popupGroup: "Plan Section",
    listItems: [{
        popupItems: {
            //list of items of Popup menu, positive number indicates default selection
            "Civil": +1,
            "Struct": -1,
            "Arch": -1,
            "MEP": -1
        }
    }],
    // This maps to a Radio Group in the PDF named 'Status'
    radioGroup: "Type of Plans",
    radioButtons: [
        // value maps to the 'Choice' of each radio button in the group, description will show on the dialog
        { value: "", description: "Original Plans" },
        { value: "Revised Plans", description: "Revised Plans" },
        { value: "As-Built Plans", description: "As-Built Plans" }
    ],
    radioErrorMsg: "Please select a status"
}

  

This topic is closed to new replies. Start a new post to keep the conversation going.

8 replies

Thom Parker
Community Expert
Community Expert
Oct 14, 2022 6:47 AM UTC

This isn't dialog box code.  It's a data structure someone designed for a tool that creates the actual dialog box code. To find out how this structure is used to set a radio button default, you need to ask whoever developed the tool.  Where did you get it?

 

A better tool for generating dialog boxes is AcroDialogs:

https://www.pdfscripting.com/public/ACRODIALOGS-OVERVIEW.cfm

 

 

Translate
Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
Oct 14, 2022 12:03 PM UTC

These forums. Any time anyone is asked where they got it, they say they found it somewhere else in the forums as an example.

Translate