Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var dialog = {
- //Creates checkboxes and text entry field variables and initalizes them. Add new variables and initialize them here.
- cBox01:false,
- cBox02:false,
- cBox03:false,
- cBox04:false,
- cBox05:false,
- UserName: "",
- Date: "",
- commit:function (dialog) { // called when OK pressed
- var results = dialog.store();
- //Stores values of what users entered into each checkbox or text entry field. These use the "item_id" of the associated element (See next section).
- this.cBox01 = results["Chk1"]
- this.cBox02 = results["Chk2"]
- this.cBox03 = results["Chk3"]
- this.cBox04 = results["Chk4"]
- this.cBox05 = results["Chk5"]
- this.UserName = results["txt2"]
- this.Date = results["txt1"]
- },
- description:
- {
- name: "Custom Stamp Dialog Box", // Dialog box title
- elements:
- [
- {
- type: "view",
- elements:
- [
- // Note: 'static_text" and "edit_text" are used together
- // Note: "static_text" is the label for the "edit_text"
- // Note: "static_text" is a static text label
- // Note: "edit_text" is a edit text field to enter in text
- // Next elements are check boxes. Copy the below bracketed block to make a new checkbox.
- {
- type: "check_box",
- item_id: "Chk1",
- name: "Approved"
- },
- {
- type: "check_box",
- item_id: "Chk2",
- name: "Approved as Corrected"
- },
- {
- type: "check_box",
- item_id: "Chk3",
- name: "Revise and Resubmit"
- },
- {
- type: "check_box",
- item_id: "Chk4",
- name: "Rejected"
- },
- {
- type: "check_box",
- item_id: "Chk5",
- name: "For Information Only"
- },
- // Next elements are the Approved by and Date fields. You will need to copy both the static_text and edit_text bracketed sections to make a new text field.
- {
- name: "Date:",
- type: "static_text",
- },
- {
- item_id: "txt1",
- type: "edit_text",
- defaultValue: "this.getField("Date").value = util.printd("m/dd/yyyy", new Date());",
- multiline: false,
- width: 250,
- height: 30
- },
- //New text field
- {
- name: "Approved By:",
- type: "static_text",
- },
- {
- item_id: "txt2",
- type: "edit_text",
- defaultValue:"this.getField("UserName").value = util.println(Collab.user);",
- multiline: false,
- width: 250,
- height: 30
- },
- // Next element is the Ok and Cancel buttons. DO NOT REMOVE THESE.
- {
- type: "ok_cancel",
- ok_name: "Ok",
- cancel_name: "Cancel"
- },
- ]
- },
- ]
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment