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

157

Likes

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

Adobe Community Professional , Nov 13, 2018 Nov 13, 2018
var text1 = "name:";var text2 = "";var text3 = text1;if (text2 != "") text3 = text3 + " " + text2;

Likes

Translate

Translate
Adobe Community Professional ,
Nov 12, 2018 Nov 12, 2018

Copy link to clipboard

Copied

In your code you adds the spaces like this:

+" "+

Likes

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 +" "+

Likes

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

Copy link to clipboard

Copied

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

Likes

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?

Likes

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
Adobe Community Professional ,
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;

Likes

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