Copy link to clipboard
Copied
I'm new here however, I'm working with an existig stamp and code done by someone else. When I post the stamp, the dialog pops up for me to select one checkbox and input text in to 5 text boxes. The other 2 text boxes on the dialog (name, date) are prepopulated (via the code) . When I click Ok, the stamp only displays the current date and output from one selection. It is supposed to display:
The checkbox I clicked
The text I entered in the correspoinding fields
And the prepopulated name should carryover as well.
Why is only 1 field displaying properly?
The radio-buttons in the stamp file itself should be named "Action" for your current code to work. You can name the ones in the dialog whatever you want (as long as its 4 characters). The two are not related.
Copy link to clipboard
Copied
No. There's no need for the app-level script file.
PS. The field you misspelled is "ACTION". It's actually "Action". Remember that JS is case-sensitive!
Copy link to clipboard
Copied
You should remove the "#1", "#2", etc. part from the "Action" field names, by the way...
Copy link to clipboard
Copied
And you wrote "SUB NO" instead of "SUB_NO"...
Copy link to clipboard
Copied
I deleted app level script. Btw, when are they necessary? I removed #'s, corrected sub no, saved the file and still same result. What the heck am I missing?
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
The field with the name "Action" doesn't exists in the stamp.
Copy link to clipboard
Copied
So each radio button should be named "Action" or code changed to "Rad"?
Copy link to clipboard
Copied
Use the name of the checkbox group "Rad" in the script.
Copy link to clipboard
Copied
Rad as the group or item_id?
Copy link to clipboard
Copied
I mean the checkbox group in the form.
getField("Rad").value = JSADMDlg1.strACT1;
Copy link to clipboard
Copied
The radio-buttons in the stamp file itself should be named "Action" for your current code to work. You can name the ones in the dialog whatever you want (as long as its 4 characters). The two are not related.
Copy link to clipboard
Copied
Thanks. It's working now. 4 characters...yes.
But I've got another question for ya: What are your suggestions on making this Stamp available for end users in networked environment?
Copy link to clipboard
Copied
None. It has to be installed on the local computer of each user.
Copy link to clipboard
Copied
Thank you very much for all your help!
Copy link to clipboard
Copied
I set a field as required and yet the stamp still "worked".
I set a field's format to number yet after the default error msg, the stamp still worked
How do I prevent the stamp from working until the user satisfies both requirements?
Copy link to clipboard
Copied
Not possible. You can't prevent the stamp from being applied. What you can do is not close the dialog window when they press OK until they fill in the fields with valid data. To do that use the validate function of the dialog object.
Copy link to clipboard
Copied
I've tried this unsuccesfully. I placed the below in the "Validate" tab in the "Run custom validation script" of the Project text field as a way to prevent the stamp from containing blank fields. The name and date on the stamp are auto populated, and I have a Notes field that is optional. But, the request is enforce data input for the 3 remaining fields on the stamp.
event.rc = true;
if (event.value = "")
{
app.alert("Project is required.");
event.rc = false;
}
Copy link to clipboard
Copied
Read my reply again. You have to do it in the dialog object.
Copy link to clipboard
Copied
I put this in above the getField commands but it isn't working. Is it the script, where I inserted it...both?
function checkText()
{
var showText1 = document.getElementById("prj1").value;
{
if(showText1.value ="")
alert('please enter text into prj1');