MatLac
Engaged
MatLac
Engaged
Activity
‎May 16, 2020
03:15 PM
that's a rookie mistake, lol, i'll correct this
... View more
‎May 16, 2020
02:33 PM
First, you need to assign the values of all three fields to variables: var a = this.getField("name of field A").value
var b = this.getField("name of field B").value
var c = this.getField("name of field C").value Then for the calculation, I noticed that your first formula only considers var b to be equal to 2 and var c to be <= 35so: if ((b == 2)&&(c <= 35)){
//insert code here
} you will nest the next if inside the first one: if ((b == 2)&&(c <= 35)){
if ((a >= 0)&&(a < 1339)) event.value = "Profil D"
else if ((a >= 1340)&&(a < 1674)) event.value = "Profil C"
else if ((a >= 1675)&&(a < 2344)) event.value = "Profil B"
else if ((a >= 2345)&&(a < 3684)) event.value = "Profil A"
else if (a >= 3685) event.value = "Profil A+"
else event.value = ""
}
else event.value = "" So the full code (assuming only integer will show in your fields) in the calculate script of your answer field (D9 in your example): //Assign variables
var a = this.getField("name of field A").value
var b = this.getField("name of field B").value
var c = this.getField("name of field C").value
//Calculation
if ((b == 2)&&(c <= 35)){
if ((a >= 0)&&(a < 1339)) event.value = "Profil D"
else if ((a >= 1340)&&(a < 1674)) event.value = "Profil C"
else if ((a >= 1675)&&(a < 2344)) event.value = "Profil B"
else if ((a >= 2345)&&(a < 3684)) event.value = "Profil A"
else if (a >= 3685) event.value = "Profil A+"
else event.value = ""
}
else event.value = ""
... View more
‎Jun 21, 2019
08:24 AM
I tried different tools for creating redaction masks/template but I couldn't find something that suits our needs. The pages inside our documents could be arranged in any order. We are looking for a way to create redaction templates we could apply on a page of our choice inside a document. For example: We have paper forms A, B, C, D, E which are scaned in no particular order and joined in a document. We would like to have redaction template A, B, C, D, E as well to manually apply on each form (pages). All the tools I tried use the template on the first page with the ability to repeat the template to other pages. None let me apply template C to only page 3 for instance.
... View more
‎Apr 05, 2019
07:17 AM
Wouldn't the user get an empty document then? Because there is nothing else in the doc than this one page and a button to spawn more of the same page.
... View more
‎Apr 05, 2019
07:03 AM
For the life of me, I can't use this function correctly. I just want to spawn a blank template and have the page be correctly numbered in the bottom when the user completes the form but needs another page to go on. If I leave the template visible (as page one), it duplicates a filled copy of my template. I need the new page to be blank. So I figured the template needs to be blank and hidden. for it to spawn correctly. To hide a blank template, I first need to spawn a copy with bRename: true which correctly puts a prefix to the page created "P1". But once I spawn a second page from the hidden template, it has the same prefix of "P1". Then the others gets incremental correctly. So the first two pages are still Identical. and for the page numbering I have these 2 calculate script event.value = this.pageNum + 1 //this value changes according to the page a value has been changed on event.value = this.numPages //this show the correct value What am I not getting right?
... View more
‎Sep 18, 2018
12:13 PM
2 Upvotes
I also noted the poster refered to a radio value of "PickUp" first and than "Pickup" with a lowercase "U". Just make sure you use the right one.
... View more
‎Sep 18, 2018
09:27 AM
Assuming your radios are named "ShipMeth" and their values are "UPS" and "PICKUP" Inside TaxTot calculation script: var UPSTax = this.getField("TUPSTaxt").value var LocTax = this.getField("LocTax").value var shipMeth = this.getField("ShipMeth").value if (shipMeth == "UPS") this.getField("TaxTot").value = UPSTax else if (shipMeth == "PICKUP") this.getField("TaxTot").value = LocTax else this.getField("TaxTot").value = 0
... View more
‎Sep 18, 2018
05:55 AM
in the custom calculation script of subtotal: if (event.value == ""){ //Put in your calculation script event.value = //the result of the calculation } Basically what you are doing is not doing the calculation if something is entered manually.
... View more
‎Aug 02, 2018
03:42 PM
And to quickly identify which one, add an alert into your for loop that indicates the value of i in the console. You will instantly find which item in the array is wrong. for (var i in highlight) { console.println("\rLast attempt was item no "+i) var f = this.getField(highlight); if (btn.hidden == true) { f.strokeColor = color.white; } else { f.strokeColor = color.black; } }
... View more
‎Jun 18, 2018
09:55 AM
In the mouse up event of button: var cResponse = app.alert("You are about to delete this page.\n\n\tDo you wish to proceed?",2,2) if (cResponse == 4) this.deletePages(this.pageNum) Be aware that deleting a page that is not the last one will disrupt the logical naming of your fields and might affect other scripts. If you need to avoid this, just add an if statement that ensures you are deleting the last page of the doc
... View more
‎Jun 18, 2018
09:47 AM
You wish to find ANY sequence of 10 numbers or a particular sequence?
... View more
‎Jun 18, 2018
09:45 AM
If the values are in different fields, and you used a naming convention for those fields, it is possible.
... View more
‎Jun 15, 2018
09:04 AM
1 Upvote
In JS, you first need to "define" variables and "assign" values to them before using them in a calculation you tell JS: this is a variable (not just some characters) by using "var" You assign a value to your variable with the assignement operator "=" And you retrieve a value from a field with the .value property of the field targeted using the getField() method Try this instead: var j1WBC = this.getField("j1WBC").value var j3WBC = this.getField("j3WBC").value var i3WBC = this.getField("i3WBC").value var rWBC = (j1WBC-j3WBC)/(i3WBC-j3WBC) this.getField("rWBC").value = rWBC
... View more
‎Jun 15, 2018
08:55 AM
I am curious why use the On blur event rather than just the validate event of the first field?
... View more
‎Jun 14, 2018
05:38 PM
Problably your fields all share the same name. isBoxChecked() has a parameter that represents: "The 0-based index of an individual radio button or check box widget for this field. The index is determined by the order in which the individual widgets of this field were created (and is unaffected by tab-order). Every entry in the Fields panel has a suffix giving this index, for example, MyField #0." So you need to change the number to reflect the targeted box alessiab66245732 a écrit I have another issue now, that when I select the checkbox "another country" it appears the dropdown menu with the list, but unfortunately if I press the other checkbox the dropdown menu doesn't disappear, it stays there. I would like this dropdown menu to disappear when the customer clicks back on the other checkbox.. do you have any suggestion? What "Other checkbox" are you refering to?
... View more
‎Jun 14, 2018
05:31 PM
BarlaeDC a écrit Hi, If you use the code above in a calculation script, would it not make all the fields you haven't got to yet ( assuming they are blank to start with) read only before the user gets to fill it in? No because the value of the fields the user have not reach is still "", thus triggering the if statement I provided. BarlaeDC a écrit This would probably need to be on each fields validate ( or calculate) event, but you could store the function globally as a document script which you could then call. Your script, document level script would work great as a validate script as you said, but not as a calculate script. Although it would produce the same result in the end, you need to remember a calculate script runs EVERY TIME a value is commited, regardless of where it was commited from. So to quote you again, if the user enters a value to field1, field2 and field3 will run their own calculate script also, for nothing. When only 3 fields are involved, it's no problem. But when you have many it can slow everything down. A script should run only when needed to. In my opinion, the doc-level function/validate event combo is the best solution but just a bit more complicated to understand for a begginer.
... View more
‎Jun 13, 2018
12:40 PM
To extract the numbers, you could loop throught all fields of the doc, use the split() method of the string object to separate each words, put everything in an array, use the indexOf method to spot the occurence of "EA" and target the +1 indice. Is there any chance you might encounter EA twice in the same field?
... View more
‎Jun 13, 2018
12:29 PM
1 Upvote
var numSeq=""; var finalpage=0; for (var p = 0; p < this.numPages; p++) { for(var n = 0; n<this.getPageNumWords(p); n++){ if(this.getPageNthWord(p,n)=="EA"){ numSeq=this.getPageNthWord(p,n+1) finalpage=p; break; } } for(var p2=p+1; p2<this.numPages; p2++){ for(var n2=0; n2<this.getPageNumWords(p2); n2++){ if(this.getPageNthWord(p2,n2)=="EA"){ this.extractPages({ nStart: p, nEnd: p2-1, cPath: numSeq+".pdf"}); break; } } console.println("Extracted " + numSeq + " pp " + p + " to " + p2) break; } } this.extractPages({ nStart: finalpage, nEnd: this.numPages - 1, cPath: numSeq + ".pdf" }); console.println("Extracted" + numSeq + " pp " + finalpage + " to " + (this.numPages - 1))
... View more
‎Jun 13, 2018
12:21 PM
What do you mean by "cutting the JS". If part of the code is missing, how can it be working fine?
... View more
‎Jun 13, 2018
10:17 AM
I am not quoite sure I'm getting what you are trying to achieve but I will help you sort things out. Are you sure you want the field to lock as soon as a value is commited to it. What if the user makes an error? Will he have to start all over again? Using a calculate script, you would not have to put the script in every field manually. A calculate script runs each time a value is changed in your document. The script you wrote would best be used as a validation script, and it would have to be entered manually for every field unless you use a document-level script. But since you used a calulate script, you only need to have it at one place, but target all the fields instead of event.target . var myFields = ["field 1", field 2", "field 3"] //add them manually or through a loop for (i in myFields){ var f = this.getField(myFields); if (f.value == "") f.readonly = false; else f.readonly = true; }
... View more
‎Jun 13, 2018
10:01 AM
I would suggest the following 1. use a keystroke event to authorize only digits and the "/" character 2. Test the length property (7, 4 or 10) to determine the format chosen by the user 3. if the result is 7 or 10, Try to convert the string to a date Object to reject any value that is not a valid date
... View more
‎Jun 13, 2018
09:50 AM
how about: if (event.target.isBoxChecked(0)){ this.getField("Select a location").display = display.visible } else{ this.getField("Select a location").display = display.hidden }
... View more
‎Jun 12, 2018
07:52 AM
Use the response() method of the app object and set the answer's default value to the link you want. Response() is usually used to recover a user's answer to a question and use that value to some purpose. Using that method, you can also set a default answer which is conviniently highlighted by default. All the user has to do is copy/paste. app.response({ cLabel: "Use this link:", cDefault: "https://forums.adobe.com/ " })
... View more
‎Jun 01, 2018
05:37 PM
2 Upvotes
True.thanks if (this.getField("food.type").value == "fruits"){ this.getField("food.name").setItems([" ", "Apple", "Oranges", "Bananas"]) } else if (this.getField("food.type").value == "vegetables"){ this.getField("food.name").setItems([" ", "Potatoes", "Carotts", "cabbage"]) }
... View more
‎May 31, 2018
05:43 PM
3 Upvotes
You could use the setItems() method of the field object instead of hiding and showing fields. The setItems() method will change the choices of a dropdown menu dynamically by inserting the elements of an array as choices For example, let's say you have 2 dropdown fields named "food.type" and "food.name" if (this.getField("food.type").value = "fruits"){ this.getField("food.name").setItems([" ", "Apple", "Oranges", "Bananas"]) } else if (this.getField("food.type").value = "vegetables"){ this.getField("food.name").setItems([" ", "Potatoes", "Carotts", "cabbage"]) } the choice you make in the first field changes what is available in the second field
... View more
‎May 29, 2018
11:36 AM
First, you turn the code into a function and name it goToNext() like this function gotToNext(){ //place code here } You move the code at document level tool / javascript / document-level and you call goToNext() from the keystroke event goToNext() instead of explicitly naming the next field, you pass it as an argument goToNext("Text2") function gotToNext(x){ //code this.getField(x).setFocus() //update this part //code } And to overkill it, use an increment to automatically apdate the value of next field (providing you named your fields just right) Given: "Text.1", "Text.2", "Text.3", etc //return name of target field //Update the value of suffix (+1) //Join the string //Pass the new string as an argument
... View more
‎May 28, 2018
08:14 AM
One thing for sure, if RSD is automaticcaly caluclated (i.e. in a calculate script), you can't increase or decrease its value by just manipulating the result because the calculate event will fire after your intervention, resuming the value to what it was before. Either you add an invisible "offset" field that will take part of your calculation and you can change its value with your buttons Or instead of a calculate script, you use the combination of a doc-level script called from the validation event of your input fields. That way, will be able to manipulate the result without a calculate script thats fires everytime you do.
... View more
‎May 28, 2018
08:00 AM
1 Upvote
This is the code you would put in the custom keystroke event of "Text1" so it tabs to "Text2" as soon as a non-empty (erase) String is keyed in. if (event.willCommit == false){ if (event.value != ""){ if (event.change != "") this.getField("Text2").setFocus() } else this.getField("Text2").setFocus() } It will handle punching a character from nothing, changing a character that was previously there but will not tab when erasing a character If you do not wish to manually copy and modify this script across all your fields, place this script in a document-level script and call it from the field, passing the name of the field as an argument.
... View more
‎May 25, 2018
12:22 PM
On the right pane: tools/javascript Create a name for your script (use the name of the function you are about to create) and click "add" then it shows like this: you created a document level function you call that function whenever you need the code to "run" simply with this line: manProdColor() You can call the function from the validate or the calculate event, from another function, etc. So instead of having to copy the same script to a bunch of fields, you create a function and call that function from those fields. If you need to change something inside the function, you make the change only once instead of having to go into each individual fields. here is a simple example: function hello(){ app.alert("hello world") } hello() //Calling the function hello() from a button will launch the alert. If you have a tousand buttons of such and want to change the string to "hello universe", you better wish you used a function instead of hardcoding the same thing 1000x. You can also pass values as arguments to a function and return a value from a function: function doubleMe(x){ return x * 2 } var a = 10 var b = doubleMe(a) //b = 20
... View more
‎May 25, 2018
05:41 AM
1 Upvote
There is a lot of things in there. First, line 53 to 60 are twice the same thing. You got 2 print commands, one at line 31 that is called every time, and one at line 46 when the user answers yes to the prompt. You update strMissing each time a field is empty, losing the information about the previous empty field. The correct way to implement this is the following: -Go ahead with the tests just as you did using "if" for each line, not "else if" -Change this: strMissing += strMissing+"\npetitioner's name"; it will create some sort of list by appending each empty field at the end of the string. the \n is a carriage return. The user will have all the missing fields in view instead pf the last one. For the last part, start off by creating your print params then: if (strMissing.lenght){ //Here you put all the prompting behavior to override the tests (ajustements to strMissing, the app.alert, etc) } else{ //Here goes the behavior when all test pass } Finally, to make it a lot shorter, you should place each field name in an array and loop your test trought that array. In that loop, you update strMissing. If you ever want to remove or add a field to test, you just update the array which saves a lot of time.
... View more