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

Validation script on dropdown list field depended on other dropdown list

Community Beginner ,
Jun 11, 2023 Jun 11, 2023

sothon30432401k4f0_1-1686500650251.png

Hi, anyone can help me to make this happen? field#1 dropdown list is group like (Fruit) and field#2 dropdown list is type of fruit. I have many pages kind of fruit and I want to select feild#1 dropdown list it show kind of field #2. I tried many time but it seem error while we select group field#1 again it only go to page.

I tried following code from peoeple here in validation field#2 in Run Custom validation script as following: 

if(event.value == "apple") this.pageNum = 1;
else if(event.value == "banana") this.pageNum = 2;

 

any Error in above scrip? Or any suggestion beside make validation script?

TOPICS
Create PDFs , Edit and convert PDFs , JavaScript , PDF , PDF forms
1.1K
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 ,
Jun 11, 2023 Jun 11, 2023

The script is OK. 

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 Beginner ,
Jun 11, 2023 Jun 11, 2023

Yep the script is running well if dropdown list field#2 is independent. Any idea make this dependency to dropdown list field#1? I tried make it denpendency but seem not working while I tried to click field#1 it going to page all time. In short, I can't select field#1.

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 ,
Jun 11, 2023 Jun 11, 2023

What script does you use at field#1?

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 Beginner ,
Jun 12, 2023 Jun 12, 2023
I put dropdown propterties => Format as following code:
/*
LICENSE:
acrojs_dependentList.js by Joel Geraci is licensed under a Creative Commons Attribution 4.0 International License.
 
You are free to:
Share — copy and redistribute the material in any medium or format
Adapt — remix, transform, and build upon the material for any purpose, even commercially.
 
Setup:
For list boxes:  Add this script to the "selection change" script of the master list box.
For combo boxes: Add this script to the "custom format" script of the dropdown box. 
 
IMPORTANT!
Edit the following line to identify the field name of the dependent list box then edit the properties of the dependentListValues JSON object. Property names should correspond to the export values of the list items.
*/
var dependentListBoxFieldName = "article";
var dependentListValues = 
{
"Friuit": [
["Apple"],
 

 

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 ,
Jun 12, 2023 Jun 12, 2023
var dependentListBoxFieldName = "article";
var dependentListValues = 
{
"Friuit": [
["Apple"],

This script makes no sense.

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 Beginner ,
Jun 15, 2023 Jun 15, 2023

sad I can't solve this issue. I have no script skill.

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 ,
Jun 15, 2023 Jun 15, 2023
LATEST

Look at the sample by Joel Geraci.

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