javascript in text field on PDF

Jan 04, 2018

Copy link to clipboard

Copied

Hi

Can anyone help with a javascript for this scenario:

I have a full length line of static text which is set in indesign, at the beginning of the line sits a dynamic text form field, within this field we have the following javascript that makes the text within the box dissappear when end user fills in the field.

var message = 'final/balloon payment'

if (event.value == '') {

    event.target.display = display.noPrint

    event.value = message

} else {

    event.target.display = display.visible

}

PROBLEM (see link) -  The text field when complete leaves empty character space until the static text begins. Is there any way the complete line can be dynamic? So it looks a complete line with no white spaces???

http://ftp.splashprinting.co.uk:82/f/Screen%20Shot%202018-01-04%20at%2015.40.47.png

thanks in advance, note I am not a coder, i found the existing script online.

It can only be done if the entire sentence is a part of the same text field.

TOPICS
Acrobat SDK and JavaScript, Macintosh

Views

179

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

javascript in text field on PDF

Jan 04, 2018

Copy link to clipboard

Copied

Hi

Can anyone help with a javascript for this scenario:

I have a full length line of static text which is set in indesign, at the beginning of the line sits a dynamic text form field, within this field we have the following javascript that makes the text within the box dissappear when end user fills in the field.

var message = 'final/balloon payment'

if (event.value == '') {

    event.target.display = display.noPrint

    event.value = message

} else {

    event.target.display = display.visible

}

PROBLEM (see link) -  The text field when complete leaves empty character space until the static text begins. Is there any way the complete line can be dynamic? So it looks a complete line with no white spaces???

http://ftp.splashprinting.co.uk:82/f/Screen%20Shot%202018-01-04%20at%2015.40.47.png

thanks in advance, note I am not a coder, i found the existing script online.

It can only be done if the entire sentence is a part of the same text field.

TOPICS
Acrobat SDK and JavaScript, Macintosh

Views

180

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
Jan 04, 2018 0
Jan 04, 2018

Copy link to clipboard

Copied

It can only be done if the entire sentence is a part of the same text field.

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
Reply
Loading...
Jan 04, 2018 0
Jan 04, 2018

Copy link to clipboard

Copied

Hi thanks for your response, could you give me some advice on how to create this please. Do I just copy the paragraph into my existing Java script?

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
Reply
Loading...
Jan 04, 2018 0
Jan 04, 2018

Copy link to clipboard

Copied

Yes. And you would need to create a custom format or validation script to populate the field with the static text, after the user enters the dynamic part.

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
Reply
Loading...
Jan 04, 2018 1
Mar 13, 2018

Copy link to clipboard

Copied

I have the same issue, and have been searching everywhere. I am not sure what exactly do you mean? What would that script look like?

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
Reply
Loading...
Mar 13, 2018 0