Copy link to clipboard
Copied
I've created a numerous amount of check boxes to populate a sentance in one main text area. I have this basic code used under Custom Calculation Script:
------------------------------------------------------------------------
var a =""
if (this.getField("sample text").value =="Yes")
{
a=a + "R - sample text. "
}
event.value=a
------------------------------------------------------------------------
When i go to the main text area that contains that code and i click in it...i see the populated sentance i wanted, but what i want is to add more text to it....when i try to type in..it shows up fine, but when i click out of the text area, it disappears...i need it to stay.
please help.
Then use this code as the Mouse Up script of the check-box, and remove the one you have as that field's calculation script:
if (event.target.value!="Off") this.getField("Service Summary").value = "R - sample text. ";
Copy link to clipboard
Copied
That's tricky... You need to tell the script to only apply the automatic calculation if the source fields are changed, but that will overwrite any values you manually entered to it.
Copy link to clipboard
Copied
well see this form is being used as a mechanic check list...meaning....there are 2 check boxes per line....
one check box generates the "R - with description". R meaning Repair
another check box generates the "U- description". U meaning Unsafe
the idea behind it is....the mechanic clicks R (checkbox) or the U checkbox....and that sentence populates in the text area below, to which he writes in addition to that generated sentence, and describes what kind of repairs or why its unsafe. But the entire text including the populated one disappears when clicked away from that box.
not sure if this helped pinpoint my exact problem?
Copy link to clipboard
Copied
What is the name of the text field?
Copy link to clipboard
Copied
Service Summary
Copy link to clipboard
Copied
Then use this code as the Mouse Up script of the check-box, and remove the one you have as that field's calculation script:
if (event.target.value!="Off") this.getField("Service Summary").value = "R - sample text. ";
Copy link to clipboard
Copied
Ooof.....i see.
problem there is..this document has 73 lines of check boxes...2 check boxes per line
so i'd have to do that for every single one...hmm....
Okay, i think i can live with doing this fix tho...
make 2 text areas....exactly the same..one with just the code and another with a regular text input.....so basically the text area where the populated text appears i will Ctrl+A Copy and paste to the second therefore allowing me to edit, and add extra comments.
Thank you for the code, i do appreciate your help..i will try that option in the future when another form is needed...it would save me then by doing an extra step.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now