Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Help with JavaScript.

Avatar

Avatar
Level 1
sparrowk1
Level 1

Likes

0 likes

Total Posts

4 posts

Correct Reply

0 solutions
View profile

Avatar
Level 1
sparrowk1
Level 1

Likes

0 likes

Total Posts

4 posts

Correct Reply

0 solutions
View profile
sparrowk1
Level 1

15-11-2016

Hi Experts -

I have a JavaScript that worked well in Acrobat. Its function is to tick a checkbox when text is entered into a text field.  I'm trying to apply the JavaScript to do the same thing to another set of boxes (text field and checkbox) in LifeCycle. 

In LifeCycle - I have entered the JavaScript in Script editor, and have 'Show: Validate*'.  Unfortunately it is not working - any help  greatly appreciated. JavaScript from  forum expert kindly supplied is: 

this.getField("checkbox 1").checkThisBox(0, (event.value!=""));

Kind regards

Kevin

Accepted Solutions (0)

Answers (3)

Answers (3)

Avatar

Avatar
Level 1
sparrowk1
Level 1

Likes

0 likes

Total Posts

4 posts

Correct Reply

0 solutions
View profile

Avatar
Level 1
sparrowk1
Level 1

Likes

0 likes

Total Posts

4 posts

Correct Reply

0 solutions
View profile
sparrowk1
Level 1

25-11-2016

Thank-you, appreciate your reply. 

I'm going to look into this now. 

Thanks again

Kevin

Avatar

Avatar
Boost 50
MVP
_Bruce_Robertson
MVP

Likes

270 likes

Total Posts

1,782 posts

Correct Reply

372 solutions
Top badges earned
Boost 50
Boost 5
Boost 3
Boost 250
Boost 25
View profile

Avatar
Boost 50
MVP
_Bruce_Robertson
MVP

Likes

270 likes

Total Posts

1,782 posts

Correct Reply

372 solutions
Top badges earned
Boost 50
Boost 5
Boost 3
Boost 250
Boost 25
View profile
_Bruce_Robertson
MVP

21-11-2016

Hi Kevin,

A LiveCycle form has a different object model than an Acroform.  You might want to start with this information LiveCycle Learn & Support  .

But you probably want to have some JavaScript in the calculate event of the checkbox that refers to the text field, so works the other way round to the code you have, something like;

TextField1.isNull ? 0 : 1;

(You don't need a return keyword)

This assumes you haven't change the default checkbox values of on/off from 1 and 0.

Regards

Bruce

Avatar

Avatar
Boost 5
Level 2
try67
Level 2

Likes

14 likes

Total Posts

120 posts

Correct Reply

1 solution
Top badges earned
Boost 5
Boost 3
Boost 10
Boost 1
Affirm 1
View profile

Avatar
Boost 5
Level 2
try67
Level 2

Likes

14 likes

Total Posts

120 posts

Correct Reply

1 solution
Top badges earned
Boost 5
Boost 3
Boost 10
Boost 1
Affirm 1
View profile
try67
Level 2

15-11-2016