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

if will i select Item no. from dropdown menu then automatically show description and price column

Explorer ,
Feb 23, 2024 Feb 23, 2024

Hi Community, I am facing a big issue with Adobe Acrobat. I want to merge 2 MS Excel taps with the same functionality.

I have 5 columns 1. Item no. 2. Description 3. Unit cost 4. Qty 5. Total

I need just the first 3 columns' funtionalites.

 

If I select the "item no.'' from the dropdown column then automatically shows a ''description'' column text (this column should not be another dropdown just 1 line text column) and another column has a unit cost.

Please check my attachment. WHOLE ADOBE ACROBAT MUST BE MOBILE-FRIENDLY.  Thanks

TOPICS
Modern Acrobat
8.8K
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
1 ACCEPTED SOLUTION
Explorer ,
Feb 25, 2024 Feb 25, 2024

I have successfully easily entered item no. on the drop-down menu but I am still facing the issue of not showing the description and prices. Please check 2 attachment of screenshot

I am adding a simple fillable box in the description and unit cost. do I need also a dropdown menu in the description and unit cost?

I am going to item no. property and go to  'Custom calculation script'  and add the below script

 

var cData = [
{item: "Item1", desc: "Description1", cost: 100},
{item: "Item2", desc: "Description2", cost: 120},
{item: "Item3", desc: "Description3", cost: 150}];


if(event.value !== "Select item"){
for(var i=0; i<cData.length; i++){
if(event.value == cData[i].item){
this.getField("description").value = cData[i].desc;
this.getField("Unit Cost").value = cData[i].cost;
break;}}}
else {
this.getField("description").value = "";
this.getField("Unit Cost").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
Explorer ,
Feb 23, 2024 Feb 23, 2024

Hi Community, I am facing a big issue with Adobe Acrobat. I want to merge 2 MS Excel taps with the same functionality.

I have 5 columns 1. Item no. 2. Description 3. Unit cost 4. Qty 5. Total

I need just the first 3 columns' funtionalites.

 

If I select the "item no.'' from the dropdown column then automatically shows a ''description'' column text (this column should not be another dropdown just 1 line text column) and another column has a unit cost.

Please check my attachment. WHOLE ADOBE ACROBAT MUST BE MOBILE-FRIENDLY.  Thanks

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 ,
Feb 23, 2024 Feb 23, 2024

You need script to do that, and script won't work on mobile devices.

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
Explorer ,
Feb 23, 2024 Feb 23, 2024

what is any method where my client easily see this form on a mobile device? thanks

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 ,
Feb 23, 2024 Feb 23, 2024

It won't work on mobile devices.

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
Explorer ,
Feb 23, 2024 Feb 23, 2024

Okay what is script for desktop computer. Thanks 

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 ,
Feb 23, 2024 Feb 23, 2024

What are the descriptions and costs? What are field names and how many rows you have?

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
Explorer ,
Feb 24, 2024 Feb 24, 2024

Hi Nesa Nurani!

Please check my attachment. My 1st field name ''items no.'' has almost 200 items this field should be a dropdown menu. Please give me a simple method where I can add easily 200 items to the dropdown menu. 2nd field name is the ''description'' and 3rd field name is ''Unit Cost''.  Every item is related to the description and unit cost. Another field name is ''Quantity'' and ''Total Cost'' but these 2 columns are not necessarily scripts. I need ''Item No'' (the dropdown menu that has 200 Products/items), ''Description'', and ''Unit Cost'' scripts. Please help me. Thanks

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 ,
Feb 24, 2024 Feb 24, 2024

To populate lots of items in a dropdown, you can use script for that, you can run script from console or a button to populate a dropdown with items:

var dropdown = this.getField("items no.");
var cList = ["Select item","Item1","Item2","Item3"];//...continue adding all items here

dropdown.setItems(cList);

 Then you can use this script as 'Custom calculation script' of that dropdown field to get description and cost to "description" and "Unit Cost" fields when you select item from dropdown:

//here write items and descriptions/cost for each item
var cData = [
{item: "Item1", desc: "Description1", cost: 100},
{item: "Item2", desc: "Description2", cost: 120},
{item: "Item3", desc: "Description3", cost: 150}];

//this part you don't need to change
if(event.value !== "Select item"){
 for(var i=0; i<cData.length; i++){
  if(event.value == cData[i].item){
   this.getField("description").value = cData[i].desc;
   this.getField("Unit Cost").value = cData[i].cost;
   break;}}}
else {
 this.getField("description").value = "";
 this.getField("Unit Cost").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
Explorer ,
Feb 25, 2024 Feb 25, 2024

Please check the attachment. I am facing an error ''(syntax error missing ) after the argument list 1: at line 2 when entering the below code for items adding. Please remove double quotation marks. thanks

 

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
Explorer ,
Feb 25, 2024 Feb 25, 2024

The first dropdown menu script not working and again does not show anything when i am entering all scripts in the description field. Please help me. thanks

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 ,
Feb 25, 2024 Feb 25, 2024

Why did you remove quotes?

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
Explorer ,
Feb 25, 2024 Feb 25, 2024

okay, I am entering quotes but still not working. i can't add items no. and i can't add descripion and unit cost

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 ,
Feb 25, 2024 Feb 25, 2024

Why do you use quotes at the name of the dropdown?

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
Explorer ,
Feb 25, 2024 Feb 25, 2024
 
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 ,
Feb 25, 2024 Feb 25, 2024

Share your file.

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
Explorer ,
Feb 25, 2024 Feb 25, 2024

I have successfully easily entered item no. on the drop-down menu but I am still facing the issue of not showing the description and prices. Please check 2 attachment of screenshot

I am adding a simple fillable box in the description and unit cost. do I need also a dropdown menu in the description and unit cost?

I am going to item no. property and go to  'Custom calculation script'  and add the below script

 

var cData = [
{item: "Item1", desc: "Description1", cost: 100},
{item: "Item2", desc: "Description2", cost: 120},
{item: "Item3", desc: "Description3", cost: 150}];


if(event.value !== "Select item"){
for(var i=0; i<cData.length; i++){
if(event.value == cData[i].item){
this.getField("description").value = cData[i].desc;
this.getField("Unit Cost").value = cData[i].cost;
break;}}}
else {
this.getField("description").value = "";
this.getField("Unit Cost").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
Explorer ,
Feb 25, 2024 Feb 25, 2024

Hi! Nesa Nurani

thank you so much if you can solve this problem. please check my attachment. this if my file need to work. thanks

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 ,
Feb 25, 2024 Feb 25, 2024
LATEST

Your field name is "Description" not "description" like you wrote in your first post.

You are not following my instruction, I told you to run set items script from a button or a console, so remove that script from keystroke, and don't use script in both validate and calculate.

Here is the corrected file:

https://drive.google.com/file/d/1PYcZ8H9LsocZalPHpSAHHsSJ8tEJmCVJ/view?usp=sharing 

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 ,
Feb 23, 2024 Feb 23, 2024
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