Skip to main content
Participating Frequently
April 21, 2022
Answered

Adobe forms auto fill textbox

  • April 21, 2022
  • 1 reply
  • 2598 views

Hi

 

This may be a stupid question.

 

I am setting up a form for risk assessments and I have 2 drop down fields with consequesnce and Likelihood (both 1 to 5)   what i would like to automatically fill a third field with a similar total as the attached image.

is this actually possible or am I going too far with it?

 

Thank you for the thoughts on this

 

Matthew

 
This topic has been closed for replies.
Correct answer Bernd Alheit

Even on custom it comes as blank


You doesn't set event.value

1 reply

Participating Frequently
April 21, 2022

Sorry i think i was making it too hard

 

I have set a quick table up 

the total box multiply the chance and the severity boxes to give me a number between 1 and 25.

 

I then think i put action to run the below javascript,

 

(text3>=15,"extreme",IF(text3>=8<=10,"high",IF(text3>=4<=7,"Moderate",IF(text3>=3,"low"))))

 

 I have put this onto a box under risk but it is not showing anything so i think i have mucked up somewhere.

 

any help would be appriciated.

 

 

BarlaeDC
Community Expert
Community Expert
April 21, 2022

Hi,

 

I assume the result is supposed to be in the risk field, in which case the code would need to be on the calculate of the risk field and it would need to be something like

// get the value from the text3 field
// change this if the field is named differently
var text3value = this.getField("text3").value;
var riskString = "";
if ( text3Value >= 15){
riskString = "extreme";
} else if (text3Value >= 8 && text3Value <= 10){
riskString = "high";
} else if ( text3Value >= 4 && text3Value <= 7){
riskString = "Moderate";
} else if ( text3Value >= 3){
riskString = "Low";
}

event.value = riskString;
Participating Frequently
April 22, 2022

Hi

 

Thank you for this you are correct i wanted to put this into the risk field (would have helped for me to say that one sorry)

I am getting the same thing that either the script isnt working or isnt running as nothing happens in the risk field.

 

I must have an option that is set wrong (i do have it on select trigger mouse up)