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

Allow a blank calculated field to accept a manual entry

Community Beginner ,
Nov 23, 2022 Nov 23, 2022

Copy link to clipboard

Copied

Hi there,

 

I have a dropdown that is built around the name of a store. In the values, I've added the address and phone number for each store, separated by a ";". I then use a custom script to calculate based on those parts. 

 

However, in the event the store doesn't exist in the dropdown, I would like to have the calculated fields that show "address" and "phone number" to accept a manual entry. Currently, if I allow custom input into the store field, both the "address" and "phone number" fields render "undefined."

 

I currently have a blank item with no values as the default, but once custom text is entered, the other two calculated fields render "undefined."

 

For reference, here's how I've coded the "parts":

var clinparts = this.getField("ClinName").valueAsString.split(";");
var clinnamepart = String(clinparts[0]);

var clinaddpart = String(clinparts[1]);
var clinphpart = String(clinparts[2]);

event.value = clinaddpart;

 

 

TOPICS
PDF forms

Views

417

Translate

Translate

Report

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 ,
Nov 24, 2022 Nov 24, 2022

Copy link to clipboard

Copied

LATEST

A calculation script is performed each time the user clicks on any field in the document, and it "pulls" the data towards it.

You should use a Validation script or an "On blur" action script from the drop-down list to "push" the data to the text field.

Thus the data filled in the text field will not be overwritten by the calculation script.

Votes

Translate

Translate

Report

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