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

PDF form w/combo box, exporting to text box, value not updating

Explorer ,
Jul 11, 2023 Jul 11, 2023

I'm using a combo box to select different tiers of shipping methods, the export value is the cost of shipping and being populated in a text box. The text boxes Sub_Total, Shipping, and Total_Tax are summed up on the Total line. When one shipping tier is selected the script below works as it should, showing the correct export value in the shipping box. However, if a different tier of shipping is selected the total line does not update with the new shipping cost. I'm not sure how to fix the issue, any help would be appreciated.

 

var Shipping=this.getField("Combo Box0").value;

event.value=Shipping;

TOPICS
JavaScript , PDF forms
857
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 ,
Jul 11, 2023 Jul 11, 2023

If the export value is set for that option, then it should update. Make sure you tick the check-box to commit the selected value immediately, though, under the drop-down's Properties, Options tab, or you would have to exit the field for the selection to "take hold" and the calculation script to execute.

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

Thank you. I believe I found the issue. I had to remove the auto calculation on the Total line and reorder the calculation to get the shipping total to update. Weird issue. Thank you for your help!

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

The issue is the fields calculation order. When you removed the calculation and re-applied it it placed the total field at the bottom of the list, where it should have been.

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 ,
Jul 12, 2023 Jul 12, 2023

Thank you for pointing that out, in my haste I missed that step.

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 ,
Jul 13, 2023 Jul 13, 2023

@try67 I have three options for the combo box that require quoting shipping costs. I have the export values of each of the three, quote, next day am, next day pm set to "$". However, when I enter the quoted amount on the text line for shipping it reverts back to the "$". How can I change this to allow a manual entry in the shipping cost line to override the export value on the combo box? Is there a way to incorporate that into the javascript I've used in the text line? 

 

var Shipping=this.getField("Combo Box0").value;

event.value=Shipping;

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 ,
Jul 13, 2023 Jul 13, 2023

Use this:

 

if (event.source && event.source.name=="Combo Box0") {

event.value=this.getField("Combo Box0").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 ,
Jul 13, 2023 Jul 13, 2023
LATEST

@try67 that works!! Thank you!

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