Copy link to clipboard
Copied
I am completely new here, so apologies for that.
I have made very basic forms for my work place and now I would like to step up my games a little.
I have an safety inspection sheet I want to develop that has a drop down for YES, NO and N/A. If NO is selected, I need to insert a text field and a place to capture an image; I would need each condition to colour the dropdown after selection. I have attached a page of one I do longhand in word.
See, I made that sound easy! 😉
I have some experience concatenation of text, but that is as far as it stretches, any help would be appreciated.
Thanks
You can make text field and image field in advance and hide it until selection is made in dropdown field. You will need script for it, something like this as validation script of dropdown field:
if(event.value == "NO"){
this.getField("Text field").display = display.visible;
this.getField("Image field").display = display.visible;}
else {
this.getField("Text field").display = display.hidden;
this.getField("Image field").display = display.hidden;}
You will also need script to change dropdown color depen
...Copy link to clipboard
Copied
You can make text field and image field in advance and hide it until selection is made in dropdown field. You will need script for it, something like this as validation script of dropdown field:
if(event.value == "NO"){
this.getField("Text field").display = display.visible;
this.getField("Image field").display = display.visible;}
else {
this.getField("Text field").display = display.hidden;
this.getField("Image field").display = display.hidden;}
You will also need script to change dropdown color depending on choice,
Copy link to clipboard
Copied
Thank you Nesa, that was super-quick and works perfectly well.
I have adapted this to now add additional images as required, like so
if(event.value == "NO"){
this.getField("Text3").display = display.visible;
this.getField("Image4_af_image").display = display.visible;
this.getField("Image5_af_image").display = display.visible;
this.getField("Image6_af_image").display = display.visible;}
else {
this.getField("Text3").display = display.hidden;
this.getField("Image4_af_image").display = display.hidden;
this.getField("Image5_af_image").display = display.hidden;
this.getField("Image6_af_image").display = display.hidden;}
Now just need to find the colour change script.
Thank you
Mark
Copy link to clipboard
Copied
What do you want to change border or fill?
Here is sample to change border of dropdown field:
if(event.value == "N/A")
event.target.borderColor = color.black;
else if(event.value == "NO")
event.target.borderColor = color.red;
else if(event.value == "YES")
event.target.borderColor = color.green;
To change fill color, replace border with fill.
Copy link to clipboard
Copied
Copy link to clipboard
Copied
TIP: in dropdown field -> option tab check " Commit selected value immediately" so the script is executed as soon as you select value.
What lines? Sorry I'm not sure what you mean.
Copy link to clipboard
Copied
Hi Nesa
Is there a way I can tighten the lines up if the YES condition is reached, I have attached the PDF with an example. Example 1 and 2. So if YES is selected, it moves to the line below without padding, If NO is selected, then it move subsequent lines down to insert text and images.
Regards
Mark
Copy link to clipboard
Copied
If I understand it right, you want to move or create new fields depending on an answer so you don't have big empty space if "YES" is selected,unfortunatelly there is no easy way to do it in acrobat.
I would advise to keep empty space with hidden fields, it would leave you with empty space if "YES" is selected but is much easier then alternative of making very complicated script for which you would probably need to hire some1 to do it for you.