Nesa Nurani
Community Expert
Nesa Nurani
Community Expert
Activity
2 hours ago
Date field is just a text field, did you use 'Date field' tool or text field and format it as date?
... View more
‎Feb 16, 2025
12:04 PM
Some browsers may have limited or no support for JavaScript
... View more
‎Feb 16, 2025
08:54 AM
1 Upvote
As 'Custom calculation script' of dropdown field use this:
this.getField("Text11").display = (event.value == 1) ? 0:1;
... View more
‎Feb 14, 2025
09:34 AM
'includes' will not work in Acrobat, use indexOf()
... View more
‎Feb 14, 2025
08:26 AM
Sorry, I don't get it, what is different in first row than in 2nd and 3rd?
... View more
‎Feb 14, 2025
08:21 AM
For number 1, try something like this as custom format script:
if (event.value) {
event.value = event.value.replace(/^=/, "");
event.value = event.value.slice(0, -2).replace(/^(W\d{4})(\d{2})(\d+)$/, "$1 $2 $3");}
... View more
‎Feb 14, 2025
08:09 AM
Your file works fine for me.
You can just select 'Commit selected value immediately' in dropdown options.
... View more
‎Feb 14, 2025
07:49 AM
It seems like you call function from dropdown field, so in new dropdown fields change function call to include names for qty and desc fields.
This would be easier with using loop in your script, but if you want our help, you need to tell us the names of all your fields.
... View more
‎Feb 14, 2025
07:11 AM
Does your script account for new dropdown names?
You need to adapt your script to include new names when you create multiple copies.
... View more
‎Feb 12, 2025
11:18 PM
‎Feb 11, 2025
08:45 AM
1 Upvote
Just change in my script to correct field names and choices.
... View more
‎Feb 11, 2025
07:40 AM
Is your choice "Add" or "Add Funds"? Use this as calculate script of dropdown:
this.getField("Add").display = (event.value == "Add") ? display.visible : display.hidden;
this.getField("Transfer").display = (event.value == "Transfer") ? display.visible : display.hidden;
... View more
‎Feb 10, 2025
10:05 PM
1 Upvote
Remove both scripts and use this as 'Custom calculation script' of "Dropdown3" field:
var options = {
"Option1": ["ItemA", "ItemB", "ItemC", "ItemD", "ItemE"],
"Option2": ["ItemF", "ItemG", "ItemH", "ItemI", "ItemJ"],
"Option3": ["ItemK", "ItemL", "ItemM", "ItemN", "ItemO"],
"Option4": ["ItemP", "ItemQ", "ItemR", "ItemS", "ItemT"]
};
var d1 = this.getField("Dropdown1").valueAsString;
var d2 = this.getField("Dropdown2").valueAsString;
if (event.source && (event.source.name == "Dropdown1" || event.source.name == "Dropdown2")) {
var dropSelections = [];
if (options[d1] && options[d2]) {
dropSelections = (d1 === d2) ? options[d1] : options[d1].concat(options[d2]);}
if(dropSelections.length > 0){
event.target.setItems(dropSelections);}
else{
event.target.clearItems();}}
This should cover all possible combinations.
... View more
‎Feb 09, 2025
10:45 PM
You want to show value in 3rd field?
You could use this as custom calculation script of 3rd field (change "Text1" and "Text2" to your actual field names of first and second 'text boxes'):
var t1 = this.getField("Text1").valueAsString;
var t2 = this.getField("Text2").valueAsString;
if(t2 !== "")
event.value = t2;
else if(t1 !== "")
event.value = t1;
else
event.value = "";
... View more
‎Feb 07, 2025
05:59 AM
In that case you can check 'All JavaScript' to see if there are any script that affect those fields.
... View more
‎Feb 07, 2025
02:41 AM
For plus button: for (var i=2; i<=10; i++) { var f = this.getField("8 base "+i); if (f.display == display.noView) { f.display = display.visible; break;}}
For minus button: for (var i=10; i>=2; i--) { var f = this.getField("8 base " + i); if (f.display == display.visible) { f.display = display.noView; break;}} If you wish to exclude first field set loop to 3.
... View more
‎Feb 06, 2025
10:34 AM
Remove script from checkbox and use this as custom calculation script of "Text4" field:
var f = this.getField("LICENSES").valueAsString;
event.target.display = (f === "Off") ? display.hidden : display.visible;
... View more
‎Feb 05, 2025
10:27 AM
You want to change border on all fields?
You can do it using document actions,'Document Will Print' and 'Document Did Print': Will print:
for (var i=0; i<this.numFields; i++) {
var fieldName = this.getNthFieldName(i);
var field = this.getField(fieldName);
field.strokeColor = color.transparent;}
For 'Did print' change color to whichever you wish. If you have radio buttons you may want to also change borderStyle.
... View more
‎Feb 05, 2025
09:39 AM
Can you share your file?
... View more
‎Feb 04, 2025
09:47 AM
You can turn it off under Preferences ⇾ Forms ⇾ Show border hover color for fields.
Every user needs to do it on their computer.
... View more
‎Feb 03, 2025
09:23 PM
Use this as custom calculation script in "Total" field, it will calculate all checkboxes and add 6.9% increase if withdrawal is checked:
var fields = [
"MarketingPackageA",
"MarketingPackageB",
"MarketingPackageC",
"Audience Maximiser",
"Photo For Sale Sign",
"Sunset Photoshoot",
"Be Seen Social Media",
"Auctioneer’s Fee",
"Body Corporate Disclosure Statement",
"Title Search"
];
var per = 1.069;
var total = 0;
for(var i=0; i<fields.length; i++){
var f = this.getField(fields[i]).valueAsString;
if(f !== "Off")
total += Number(f);}
if(this.getField("Withdrawal").valueAsString !== "Off")
total = total*per;
event.value = total.toFixed(2);
... View more
‎Feb 03, 2025
08:44 AM
1 Upvote
Here is your original file with scripts added:
https://drive.google.com/file/d/1rlFTxWj-T2Rq-UqJtdwArqDnk9Wj_dIk/view?usp=sharing
... View more
‎Feb 03, 2025
08:29 AM
Scripts work fine with your original form, why did you change field names?
... View more
‎Feb 01, 2025
12:34 PM
I don't know why this happens, you can try to reset your computer and try again, if you have same issue try to delete field and create new field.
... View more
‎Feb 01, 2025
07:45 AM
1 Upvote
Try this:
event.rc = /^\d{0,4}$/.test(event.value + event.change);
if (event.rc) {
var newValue = event.value + event.change, len = newValue.length;
if ((len >= 1 && newValue[0] > '2') ||
(len >= 2 && parseInt(newValue.substring(0, 2), 10) > 23) ||
(len >= 3 && newValue[2] > '5') ||
(len == 4 && parseInt(newValue.substring(2, 4), 10) > 59)) {
event.rc = false;}}
... View more
‎Feb 01, 2025
04:13 AM
Then use custom calculation, there are plenty of examples with scripts on the forum that calculate time.
If you tell us what you are trying to calculate, we can help you.
... View more
‎Jan 31, 2025
11:22 PM
Why don't you use time format?
... View more
‎Jan 31, 2025
10:38 AM
Post the script you used or share the file if you can.
... View more
‎Jan 31, 2025
07:06 AM
2 Upvotes
To calculate price, use this as custom calculation script:
var c500 = 0;
var c1000 = 0;
var total = 0;
for(var i=1; i<=4; i++){
var qty = this.getField("BC"+i+"Quantity").valueAsString;
if(qty == "500")c500++;
if(qty == "1000")c1000++;}
if(c500 == 1){
total += 65;}
else if(c500 > 1){
total += c500 * 59;}
if(c1000 == 1){
total += 75;}
else if(c1000 > 1){
total += c1000 * 69;}
event.value = total;
Use this in 'Quantity' field as custom calculation script, it will add 1 when name field is filled:
var count = 0;
for(var i=9; i<=16; i++){
var f = this.getField("Name_"+i).valueAsString;
if(f !== "")count++;}
event.value = (count == 0)? "" : count;
... View more
‎Jan 30, 2025
11:55 AM
Add color.before red and black: color.red and color.black And remove one equal sign when setting color black: event.target.fillColor==black;
... View more