Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Adobe forms auto fill textbox

New Here ,
Apr 21, 2022 Apr 21, 2022

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.

A-standard-risk-matrix.pngexpand image

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

 

Thank you for the thoughts on this

 

Matthew

 
TOPICS
PDF forms
2.2K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
3 ACCEPTED SOLUTIONS
Community Expert ,
Apr 21, 2022 Apr 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;

View solution in original post

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 22, 2022 Apr 22, 2022

Use the script at calculation of the field.

View solution in original post

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 22, 2022 Apr 22, 2022

You doesn't set event.value

View solution in original post

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 21, 2022 Apr 21, 2022

Sorry i think i was making it too hard

 

I have set a quick table up 

matthew24136738a1t3_0-1650553382648.pngexpand image

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.

 

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 21, 2022 Apr 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;
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 21, 2022 Apr 21, 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)

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 22, 2022 Apr 22, 2022

Use the script at calculation of the field.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 22, 2022 Apr 22, 2022

thanks, i have put this into the custom but it still doesnt show the text.

 

I have attached the PDF I think i must have done something completely wrong, as my brain has melted away

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 22, 2022 Apr 22, 2022

Don't use Simplified field notation for the script.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 22, 2022 Apr 22, 2022

Even on custom it comes as blank

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 22, 2022 Apr 22, 2022

You doesn't set event.value

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 22, 2022 Apr 22, 2022
LATEST

if i could do a bowing emoji that worked I would put it here.

 

after all that it was mainly because i forgot the last line on the javascript that BarlaeDC put on

 

Thank you so so much

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