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

Any trick how to view with out spaces?

Explorer ,
Nov 12, 2018 Nov 12, 2018

Copy link to clipboard

Copied

var num=12

var num1=33

var hm=apple

var al=orange

if var's has values:

var num=12

var num1=33

var hm=apple

var al=orange

this.getField("Text1").value="check"+num+" "+hm+" "+num1+" "+al+" with :"

i want this

check 12 apple 33 orange

but when i have

var num=""

var num1=33

var hm=""

var al=orange

check     33 orange

why var with "" system add space? how to add "nothing"

e.g.

check 33 orange

TOPICS
Acrobat SDK and JavaScript

Views

372

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

correct answers 1 Correct answer

Community Expert , Nov 13, 2018 Nov 13, 2018

var text1 = "name:";

var text2 = "";

var text3 = text1;

if (text2 != "") text3 = text3 + " " + text2;

Votes

Translate

Translate
Community Expert ,
Nov 12, 2018 Nov 12, 2018

Copy link to clipboard

Copied

In your code you adds the spaces like this:

+" "+

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
Explorer ,
Nov 13, 2018 Nov 13, 2018

Copy link to clipboard

Copied

Yes because on this e.g

check 12 apple 33 orange

Must have +" "+

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
Community Expert ,
Nov 13, 2018 Nov 13, 2018

Copy link to clipboard

Copied

Add the space only when you add non-empty text.

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
Explorer ,
Nov 13, 2018 Nov 13, 2018

Copy link to clipboard

Copied

How to create that? Any example please?

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
Community Expert ,
Nov 13, 2018 Nov 13, 2018

Copy link to clipboard

Copied

LATEST

var text1 = "name:";

var text2 = "";

var text3 = text1;

if (text2 != "") text3 = text3 + " " + text2;

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