Copy link to clipboard
Copied
Hello all.
I have a few questions and need your help for that.
I am making a checklist for my company for checking the designs and files we put out there.
Now the questions are:
1. I want the document to be only save as, this is so people can't overwrite the file. So when you open it, it will always be an unfilled form. So people can fill it the form, but can't normaly save or edit it.
2. We have different kind of status modes for waiting on agreement of the client and waiting for files and many more. Now I already have a buttons for the status modes:
What I would really like is when I hit the checkmark, the date of today (Datum=Date) will be automatically filled on the dotted line. This is probably done by Javascript.
I hope you guys can help
Copy link to clipboard
Copied
Hi,
I will not answer to the first question, but I don't think it is possible to lock the "Save" Menu function.
For the 2nd question, place this script in calcul of each date field:
if (this.getField("CheckBox").value!="Off") {
if (event.value=="") event.target.value=new Date();
} else {
event.value="";
}
these field must set with a date format.
@+
Copy link to clipboard
Copied
Hi,
I will not answer to the first question, but I don't think it is possible to lock the "Save" Menu function.
For the 2nd question, place this script in calcul of each date field:
if (this.getField("CheckBox").value!="Off") {
if (event.value=="") event.target.value=new Date();
} else {
event.value="";
}
these field must set with a date format.
@+
Copy link to clipboard
Copied
Thanks man, the script works.
Now how can I auto activate it, so without to click the text field?
Copy link to clipboard
Copied
That code is not entirely correct. Use this instead:
if (this.getField("CheckBox").value!="Off") {
event.value=new Date();
} else {
event.value="";
}
When you tick (or un-tick) the corresponding check-box it should populate (or clear) the text field automatically.
Copy link to clipboard
Copied
Like that the date will change each time the file is open at an other date...
@+
Copy link to clipboard
Copied
No, it won't, as opening the file doesn't trigger calculation scripts.
However, you are correct that it will update each time any field in the file is changed.
If you want it to only happen when the check-box is ticked then it needs to be differently, via the Mouse Up event of the check-box itself.
Copy link to clipboard
Copied
And what if I would do it through the javascript tool:
if (this.getField("Akkoord").value!="Off") {
if ("Akkoord_Datum".value=="") "Akkoord_Datum".target.value=new Date();
} else {
Akkoord_Datum.value="";
}
Would this work?
Copy link to clipboard
Copied
Like that, the script fill the field only if it is empty, so the date will not change if there is already one indicated in the field.
@+
Copy link to clipboard
Copied
No, it won't. That script contains errors.
Copy link to clipboard
Copied
You are twice right!
1) I answered fron my phone and I didn't check the script and it is effectively wrong. I though it was the one I gave.
2) No need to add “if (event.value==""”... I checked! However, that's what I do every time.
@+
Copy link to clipboard
Copied
1. Set the file and the folder of the file as read-only.

