Expand my Community achievements bar.

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

Avatar

Level 1

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

1 Reply

Avatar

Level 7

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).