Thanks for the reference, lev!
Question time...
I am new to javascript and would like to place user input text boxes (for a custom name or custom date) into the dialog window.
moron1.png
Can you point me to a good reference for that?
And do you happen to know what version of javascript () this conforms to?
...is it closer to ECMAScript than the latest javascript?
Cheers!
Code: Select all
console.println("Shop Drawing Stamp:" + event.source.stampName);
// ========== DEFINE RADIO BUTTONS IN DIALOG BOX ==========
var DiaBox = {
result: "cancel",
DoDialog: function() {
return app.execDialog(this);
},
bChk1: false,
bChk2: false,
bChk3: false,
bChk4: false,
stredt1: "",
initialize: function(dialog) {
var dlgInit = {
"Opt1": this.bChk10,
"Opt2": this.bChk11,
"Opt3": this.bChk12,
"Opt4": this.bChk13,
};
dialog.load(dlgInit);
},
commit: function(dialog) {
var oRslt = dialog.store();
this.bChk1 = oRslt["Opt1"];
this.bChk2 = oRslt["Opt2"];
this.bChk3 = oRslt["Opt3"];
this.bChk4 = oRslt["Opt4"];
},
description: {
name: "Shop Drawing Stamp",
elements: [{
type: "view",
elements: [{
type: "view",
char_height: 10,
elements: [{
type: "static_text",
item_id: "stat",
name: "Select Review Status:",
width: 152,
height: 23,
char_width: 15,
alignment: "align_fill",
font: "dialog",
},
{
type: "radio",
item_id: "Opt1",
group_id: "grpStatus",
name: "Accepted",
},
{
type: "radio",
item_id: "Opt2",
group_id: "grpStatus",
name: "Accepted As Noted",
},
{
type: "radio",
item_id: "Opt3",
group_id: "grpStatus",
name: "Rejected, Revise & Resubmit",
},
{
type: "radio",
item_id: "Opt4",
group_id: "grpStatus",
name: "Not Accepted",
},
]
},
{
type: "gap", //Add a small vertical gap between
height: 10 //..radio buttons and text boxes
},
{
type: "gap", //Add a small vertical gap between
height: 10 //..text boxes and OK-button
},
{
type: "ok_cancel",
},
]
}, ]
}
};
// ========== END RADIO BUTTONS IN DIALOG BOX ==========
// if (event.source.forReal && (event.source.stampName == "stmpReview")) {
if (event.source.forReal && (event.source.stampName == "zAE5xDHAZ4wenFX3zDi8h0")) {
if ("ok" == app.execDialog(DiaBox)) {
// ---------------------------------------------------
// insert checkbox states into form/radio buttons
// ---------------------------------------------------
this.getField("fmBx10").checkThisBox(0, DiaBox.bChk1);
this.getField("fmBx11").checkThisBox(0, DiaBox.bChk2);
this.getField("fmBx12").checkThisBox(0, DiaBox.bChk3);
this.getField("fmBx13").checkThisBox(0, DiaBox.bChk4);
// ---------------------------------------------------
// Default textbox values
// ---------------------------------------------------
strReviewer = "Some Moron";
strDate = "Now, damnit!";
// ---------------------------------------------------
// insert default text strings into form fields
// ---------------------------------------------------
this.getField("fmTxBy").value = strReviewer;
console.println("Success1");
// ---------------------------------------------------
// insert date into form field
// ---------------------------------------------------
// cMsg = util.printd("dd mmm yyyy", new Date());
event.value = strDate;
event.source.source.info.exhibit = strDate;
}
}
You do not have the required permissions to view the files attached to this post.