Highlighted

Skipping tabs

Community Beginner ,
Jul 27, 2020

Copy link to clipboard

Copied

After filling a choicemenu with "Yes" I would like that the next field will beskipped (and it is not aible to fill it anymore).
On "Yes" I gave the exportvalue yes.
-Is it possible to skip next tab

-Is it possible to 'lock' next field (or a field of choice) after a exportvalue has been hit?
Thanks for advising me.
I think I can start with this code:
var f = this.getField("next-tab");
if (cChoice=="Yes"); {
/*lock field next-tab

goto tab-2 {*/
dunno what to use for last 2 lines, sorry.
If another exportvalue ia hit, the field must be next in tab and it must be poss. to fill.

Thanks for helping me out.

TOPICS
Create PDFs, Edit and convert PDFs, How to, PDF forms

Views

58

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Skipping tabs

Community Beginner ,
Jul 27, 2020

Copy link to clipboard

Copied

After filling a choicemenu with "Yes" I would like that the next field will beskipped (and it is not aible to fill it anymore).
On "Yes" I gave the exportvalue yes.
-Is it possible to skip next tab

-Is it possible to 'lock' next field (or a field of choice) after a exportvalue has been hit?
Thanks for advising me.
I think I can start with this code:
var f = this.getField("next-tab");
if (cChoice=="Yes"); {
/*lock field next-tab

goto tab-2 {*/
dunno what to use for last 2 lines, sorry.
If another exportvalue ia hit, the field must be next in tab and it must be poss. to fill.

Thanks for helping me out.

TOPICS
Create PDFs, Edit and convert PDFs, How to, PDF forms

Views

59

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Jul 27, 2020 0
Most Valuable Participant ,
Jul 27, 2020

Copy link to clipboard

Copied

As the custom validation script of the drop-down field enter the following:

this.getField("next-tab").readonly = (event.value=="Yes");

A read-only field is automatically skipped when you tab.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 27, 2020 0
Community Beginner ,
Jul 27, 2020

Copy link to clipboard

Copied

embrace the answer!

Thank you very much.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 27, 2020 0
Community Beginner ,
Jul 27, 2020

Copy link to clipboard

Copied

If I use the same fieldname on several pages, can I make those 'readonly' after one has been filled in?
f.i. I place a number in that field on page 1, the number will be on al other pages, but I don't like the tab to it (or to change)

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 27, 2020 0
Most Valuable Participant ,
Jul 27, 2020

Copy link to clipboard

Copied

No. If you want to do it like that give the other fields a different name, set them as read-only and then use a calculation script to copy the value of the first one to them.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 27, 2020 0
Community Beginner ,
Jul 27, 2020

Copy link to clipboard

Copied

Thanks.
Did almost so but what is the calculationscript for copy?
I tried product, that works as well instead if I start with a zero

Boxes are called D, D1, D2, D3 etc

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 27, 2020 0
Most Valuable Participant ,
Jul 27, 2020

Copy link to clipboard

Copied

To copy the value of D to D1 place the following code as the custom calculation script of the latter:

event.value = this.getField("D").value;

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 27, 2020 0
Community Beginner ,
Jul 27, 2020

Copy link to clipboard

Copied

Hi try67,

many thanks. Still the outcome is the same. I start in "D" with 00071.
Displayed in "D1" now is 71. It seems the zero's won't be copied?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 27, 2020 0
Most Valuable Participant ,
Jul 27, 2020

Copy link to clipboard

Copied

My bad. Use this:

event.value = this.getField("D").valueAsString;

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 27, 2020 0
Community Beginner ,
Jul 28, 2020

Copy link to clipboard

Copied

Thanks try67,
Works very good, superb!

Were you able to have a look at this issue as well, please?

Sorry try67,
It's not combine, it's both choices to display the same. Users must have the oportunity to make a choice in [Choose_00] or in [Choose_01]. Eigther the field they choose to use, the output will be the same.

But if they make a choice in [Choose_00] it must not be possible to make a choice in [Choose_01]
(and viceversa).
Hope I made it more clear like this?
prob also with 'readonly', but now not on a exportvalue but just on whatever the choice is made?

https://community.adobe.com/t5/acrobat/need-some-help-for-a-pdf/m-p/11300230?page=1#M267069

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 28, 2020 0
Most Valuable Participant ,
Jul 28, 2020

Copy link to clipboard

Copied

I saw that discussion but couldn't really follow what you mean... What type of fields are those "Choose_XX" fields, exactly?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 28, 2020 0
Community Beginner ,
Jul 28, 2020

Copy link to clipboard

Copied

Hi Try,
Hope to explain well.

17776181.gif

User can make a choice in eighter "Choice_00" or "Choice_01".
_00 is filled with abbreviations and _01 has longer textfields of those abbr.
The outcome in "Output_00" is programmed (exportvalue) to be the same eighter you make a choice in _00 or in _01.
I hoped to do that like this (does not work)
var cChoice  =  this.getField("Choice_00"  ||  "Choice_01");.
So far programming for the output.
Big wish is to make it sophysticated that if you choose in _00 the long output is given in _01 and the box will be readonly, or if you choose in _01 the output abbr is given in _00 and that box will be reaonly as wel. 

 

Hope it make some more sence?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 28, 2020 0
Most Valuable Participant ,
Jul 28, 2020

Copy link to clipboard

Copied

OK, so they are drop-downs. What are their default values?

The easiest way to do it is to reset the other field when a selection is made. To do that use the following code as the custom validation script of Choice_00 and Choice_01, respectively:

 

this.resetForm(["Choice_01"]);

 

this.resetForm(["Choice_00"]);

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 28, 2020 0
Community Beginner ,
Jul 28, 2020

Copy link to clipboard

Copied

Not sure what you mean with default values,
_00 Has only choices to make (abbr.)and I gave every choice a exportvalue. There's no script in the tab calculate.
_01 has choices as well (complete text of the abbr). On tab calculate there is next scriptin custom validation:
var cChoice = event.value
var f = this.getField ("Output_05");

if (cChoice==10:1 b". || cChoice==" 10:1 d"){

f.fillcolor=color.red

} else {
f.fillcolor=color.transparent
}

=========================================
First now I need to display both exportvalues from _00 or _01 into "Otput_00" (that's not working for now).
Than I mus se if I can past your code, it didn't work right now.
My way of thinking is to tell _00 that if a exportvalue is hit he has to make _01 readonly
and tell _01 same for _0)
or can I show in _01 the long text of the choice ppl made in _00 and show the abbr in _00 if they choose the long version in _01?


Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 28, 2020 0
Most Valuable Participant ,
Jul 28, 2020

Copy link to clipboard

Copied

The default value is the value the field reverts to when you reset it. It can be a single space, or "Select" or "-", or an actual value, but that would be problematic in your case.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 28, 2020 0
Community Beginner ,
Jul 28, 2020

Copy link to clipboard

Copied

ok,

default choice is just -
(I like the fields empty on start).

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 28, 2020 0
Most Valuable Participant ,
Jul 28, 2020

Copy link to clipboard

Copied

Then use the scripts I provided to reset the other field when a selection is made.

To combine the two values to a single string you can use something like this:

 

var f1 = this.getField("Choice_00");

var v1 = (f1.valueAsString==f1.defaultValue) ? "" : f1.valueAsString;

var f2 = this.getField("Choice_01");

var v2 = (f2.valueAsString==f2.defaultValue) ? "" : f2.valueAsString;

var combinedValue = v1+v2;

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 28, 2020 0
Community Beginner ,
Jul 28, 2020

Copy link to clipboard

Copied

Understnd what you mean, but the other field doesn't have to be reset, it just have to be readonly.
if _00 is filled _01 must be read only
if _01 is filled, _00 must be read only
with your script i have a loop, both reset each other permanently

The two values don't need  (or want) to be combined.
Provided code is here not working, sorry.
I now use code in Output_00:

var cChoice = thisgetfield("Choice_01").valueAsstring;
which shows a choosen text on the exportvalue of  Choice_00.
The only thing I want is that Output_00 not only displays the text on the exportvalue of _Choice_00
but also/or the text (which is the same) on the export value in Choose_00
I tried:
var cChoice = thisgetfield("Choice_01"  ||  "Choice_01").valueAsstring;
but it's not working

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 28, 2020 0
Most Valuable Participant ,
Jul 28, 2020

Copy link to clipboard

Copied

There's no loop in the code I provided, if you use it correctly.

Anyway, if you want to set the other field as read-only you can do it like this (again as the custom validation script):

this.getField("Choice_01").readonly = (event.value!=event.target.defaultValue);

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 28, 2020 0
Community Beginner ,
Jul 29, 2020

Copy link to clipboard

Copied

Hi try67,

Thanks again, I now am almost there (I guess), but figure with 2 issues in the same project, other page.

21132077.gif

I am glad that if I make a choice in "Choice_04", "Choice_05" turns into read only and vice versa.

Issue 1
In "Output_12" we wrote next custom validation script
var cChoice=this.getField("Choice_05").valueAsString; which displays only the output of "Choice_05".
I do like (or need) to display the output of "Choice_04" as wel.
*How can I display the outcome of both "Choice_04" and "Choice_05" in "Output_12"


Issue 2

Both "Choice_04" and "Choice_05" have the same custom validation script which gives output to "Output_16" (not displayed in jpg). If I only place this script in "Choice_05" It works perfect.
If I place the script in both "Choice_04" and "Choice_05", it only works with "Choice_04".
*How can I perform the script so it will work on both "Choice_04" and "Choice_05"?
used script:
"Choice_04"
var cChoice = event.value
var f = this.getField("Output_16");
if (cChoice=="1" || cChoice=="2"  ||  cChoice=="3" || cChoice=="4"  ||  cChoice=="5"){
f.fillColor=color.gray;
var f = this.getField("Output_16");
f.value  = "Here I write text 1"
} else if (cChoice=="6" || cChoice=="7"  ||  cChoice=="8" || cChoice=="9"  ||  cChoice=="10" || cChoice=="11"  ||  cChoice=="12" || cChoice=="13"  ||  cChoice=="14"){
f.fillColor=color.gray;
f.value  = "Here I write text 2."
}else {
f.fillColor=color.transparent
}
this.getField("Choice_05").readonly=(event.value!=event.target.defaultValue);


"Choice_05"
var cChoice = event.value
var f = this.getField("Output_16");
if (cChoice=="1" || cChoice=="2"  ||  cChoice=="3" || cChoice=="4"  ||  cChoice=="5"){
f.fillColor=color.gray;
var f = this.getField("Output_16");
f.value  = "Here I write text 1"
} else if (cChoice=="6" || cChoice=="7"  ||  cChoice=="8" || cChoice=="9"  ||  cChoice=="10" || cChoice=="11"  ||  cChoice=="12" || cChoice=="13"  ||  cChoice=="14"){
f.fillColor=color.gray;
f.value  = "Here I write text 2."
}else {
f.fillColor=color.transparent
}
this.getField("Choice_04").readonly=(event.value!=event.target.defaultValue);

 

Thanks so far, it's great what you already helped me with!

 

 

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 29, 2020 0
Most Valuable Participant ,
Jul 29, 2020

Copy link to clipboard

Copied

I encourage you to try and solve these issues yourself. We've provided you with the basic tools to do it.

 

If you want further help with this form from me I will need to see the actual file, and we'll need to discuss a fee for my time. You can contact me privately via [try6767 at gmail.com] to discuss it further.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 29, 2020 0
Community Beginner ,
Jul 29, 2020

Copy link to clipboard

Copied

Hi try67,
However I try to be selfsupported, both issues mentioned above, couldn't be solved by myself.
I realise you helped me out so far and so good!
Thanks anyway.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 29, 2020 0
Community Beginner ,
Aug 04, 2020

Copy link to clipboard

Copied

@try67,
So far so good.
With your help I could make just what I needed. May be I used some bypasses, but I managed.
What I don't get: I did make 5 pages. After page 1 was working like I would, I copied the code
to the next page, changed the boxnames and gues what? In 1 box the coloring of it ain't working.
It works on all 5 pages on 2 boxes each page, just by copy-ing the code.
For me it's a big ?
For all: very satified with the offered help, thanks again!

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 04, 2020 0
Most Valuable Participant ,
Aug 04, 2020

Copy link to clipboard

Copied

Did you make sure to change the names of the fields in the code after copying it?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 04, 2020 0
Community Beginner ,
Aug 04, 2020

Copy link to clipboard

Copied

Hi try67,
Double checked it. It stays as it is. Somewhere something in the code must be incompetent,
but what? Eeven if I crosscode the fieldnames, still the code in Choice_30 doesn't give the color red, but does give the text.........` Code in field "Choice_30":

var cChoice = event.value

var f this.getField("Output_37" );
if  (cChoice=="X") {

f.fillcolor=color.red
f.value = "Hello dear"}

gives no red field, but displays 'Hello, dear".

Same code in field "Choice_31"to field"Output_37a"
gives a red field and the text.

btw 'Output_37" is read only.......
At last I compared both codes from field 30 and 31 in Word.
The only diff Word shows are the fieldnumbers with and without a.
Field 31 is displaying everything to fields with a.
Besides of this I am pretty shure al exportvalues are the same (no mix up with o and 0).

Well it sure keeps me out of the sun 😉

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 04, 2020 0
Most Valuable Participant ,
Aug 04, 2020

Copy link to clipboard

Copied

I will need to see the actual file to be able to help you further with this.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 04, 2020 0
Engaged ,
Aug 04, 2020

Copy link to clipboard

Copied

Change f.fillcolor to f.fillColor

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 04, 2020 0
Community Beginner ,
Aug 05, 2020

Copy link to clipboard

Copied

Thanks Nesa,

Good tip and my mistake above. In the field it is written with Capital, srry for that.

@try67 I can e-mail you the file if you like

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 05, 2020 0
Engaged ,
Aug 05, 2020

Copy link to clipboard

Copied

If you want red background + text use this:

var cChoice = event.value;
var f = this.getField("Output_37");
if (cChoice=="X") {
f.fillColor=color.red
f.value = "Hello dear";
}


If you want to be clear text field if no "X"
add this to the code

else {
f.fillColor=color.transparent
f.value = "";
}

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 05, 2020 0