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

LiveCycle ES4: FormCalc or Java Script-Trying to create a conditional caption script based on other object value

Avatar

Avatar
Level 1
trodg80
Level 1

Likes

0 likes

Total Posts

1 post

Correct Reply

0 solutions
View profile

Avatar
Level 1
trodg80
Level 1

Likes

0 likes

Total Posts

1 post

Correct Reply

0 solutions
View profile
trodg80
Level 1

01-08-2016

Hello all,

I need some help. I think my issue is with Syntax as this is the first time I have ever tried to make a conditional caption. I am currently trying to do it in FormCalc as I am a little more familiar with that syntax than I am Java but I am willing to explore both.

The Desired Result:

I have a set of Radio Buttons that the form user should select to identify what type of hire they are trying to submit. Based on the radio button selection, the caption on a date field needs to read something different (to cut down on space usage on the form).

Information:

The Radio Buttons are Value Bound to 1="Rehire", 2="Temp to Perm" and 3="New Hire" in a Radio Button Group called HireType. The Date field is a standard date field with Size 9 Arial 9 titled StartDate.

Important Note: I am not using any kind of outside data source (XML or otherwise) to populate this information. Most of the subject matter I have been able to find about conditional captions references back to this. The form that I am designing is completely internal unto itself.

The FormCalc script I tried on the exit event for the HireType radio button group:

form1.#subform[0].HireType::exit - (FormCalc, client)

if (HireType.rawValue=="1")then

StartDate.caption.value="Original Hire Date"

else

StartDate.caption.value="Temp Start Date"

endif

The Result:

Nothing happens. I am pretty sure the solution is starting me right in the face, but this is the first time I have tried to do a conditional script with anything except the raw value of a field or the Drop Down List selection.

Any help would be greatly appreciated! Again willing to explore Java or FormCalc solutions.

Thanks in advance!

-T

Accepted Solutions (0)

Answers (1)

Answers (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

05-02-2018

Hi,

A bit late to the party, but maybe it will help you or someone else.

I am sure you are aware that by using the exit event for the code, the event wont execute until another object is clicked on.

I don't think your code is correct. HireType is the group name and does not have a rawValue. The items in the group do though.

Regardless, in Javascript to change a caption name use:

StartDate.caption.value.text.value = "Original Hire Date"; //the caption will change when another object is clicked (group exited).