Can I not an event script for a text field?

Avatar

Avatar
Boost 1
Level 1
nicolec26875103
Level 1

Like

1 like

Total Posts

8 posts

Correct reply

0 solutions
Top badges earned
Boost 1
View profile

Avatar
Boost 1
Level 1
nicolec26875103
Level 1

Like

1 like

Total Posts

8 posts

Correct reply

0 solutions
Top badges earned
Boost 1
View profile
nicolec26875103
Level 1

02-12-2018

Bear with me please, I am new to LiveCycle!

I am currently creating a form, which some questions are not required unless a particular answer is selected, So I am hoping to have the optional questions hidden from layout until an answer is selected and if the question is needed it will become visible.  This has been fine, but I realised that if someone wants to print out the form to fill it out, obviously those hidden questions are not printed.  So I started adding a script in the event "prePrint" for each hidden field - this.presence = "visible";

Which seemed to be working.  Until i came to a text field I have used as a "Caption/Question Title" for checkboxes.

For example:

// The below is currently Hidden (excluded from layout)

Example Question 2                         o Answer 1  o Answer 2 o Answer 2

I can get Answer 1, 2 & 3 to print (with their checkboxes)  but the text field I used to write the question in, won't let me put a script in any event. Is this something that is just not possible?  Or am I doing something wrong?

I would also like to know if there is a much simpler way to just have all hidden fields visible when printed?  Or if it is just adding to each event in each field like I have been?

I hope all of this makes sense!

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Validate 1
Level 4
MinusZero
Level 4

Likes

30 likes

Total Posts

326 posts

Correct reply

54 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 25
Boost 10
View profile

Avatar
Validate 1
Level 4
MinusZero
Level 4

Likes

30 likes

Total Posts

326 posts

Correct reply

54 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 25
Boost 10
View profile
MinusZero
Level 4

19-12-2018

Make Example Question 2 a TextField. You will then be able to change it's rawValue to whatever you need based on the checkbox selection. Change the caption Position to None in the layout tab and add the text in the object/value default text field.

1650484_pastedImage_0.png

1650485_pastedImage_1.png

1650486_pastedImage_2.png

I have also protected the TextField so the text can't be user changed.

This code effectively makes checkboxes work like radio buttons, only one can be checked at a time.

Is this what you are trying to do?

Answers (3)

Answers (3)

Avatar

Avatar
Ignite 5
Employee
workflowuser
Employee

Likes

136 likes

Total Posts

446 posts

Correct reply

70 solutions
Top badges earned
Ignite 5
Ignite 3
Ignite 1
Give Back 50
Give Back 5
View profile

Avatar
Ignite 5
Employee
workflowuser
Employee

Likes

136 likes

Total Posts

446 posts

Correct reply

70 solutions
Top badges earned
Ignite 5
Ignite 3
Ignite 1
Give Back 50
Give Back 5
View profile
workflowuser
Employee

07-04-2020

you cannot have events for static text fields

Avatar

Avatar
Boost 1
Level 1
nicolec26875103
Level 1

Like

1 like

Total Posts

8 posts

Correct reply

0 solutions
Top badges earned
Boost 1
View profile

Avatar
Boost 1
Level 1
nicolec26875103
Level 1

Like

1 like

Total Posts

8 posts

Correct reply

0 solutions
Top badges earned
Boost 1
View profile
nicolec26875103
Level 1

18-12-2018

I had made it a Text Object, as I couldn't figure out how to have two captions (The Question, and then the answers next to the checkboxes?

What would I use for the "Example Question 2"  so it can still be made with code in it?

For example:

Example Question 2                         o Answer 1  o Answer 2 o Answer 2

Avatar

Avatar
Validate 1
Level 4
MinusZero
Level 4

Likes

30 likes

Total Posts

326 posts

Correct reply

54 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 25
Boost 10
View profile

Avatar
Validate 1
Level 4
MinusZero
Level 4

Likes

30 likes

Total Posts

326 posts

Correct reply

54 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 25
Boost 10
View profile
MinusZero
Level 4

03-12-2018

Hi nicolec26875103​,

radzmar​ answered your other post regarding the hiding of all fields.

Check if you are you using a TextField or Text object?

The Text object cannot have any code in it.

1638416_pastedImage_1.png