Expand my Community achievements bar.

connecting selection of radio button to a text or numeric field

Avatar

Level 1

Hi. I am using LiveCycle Designer 8.0 and I am trying to define object properties that will allow the selection of a radio button to populate in a numeric data field at the bottom of the page. I was able to write the script to have that happen with drop-down lists, but I can't figure out how to write the script for the radio button. I also don't know if the script is supposed to apply to the radio button itself or the numeric field where I want the result to show-up. Can you please help me with some sort of an example script? Thanks.

8 Replies

Avatar

Level 7

In the click event for each radio button you could put (in formcalc)

numericfield = 1 // where numericfield is the name of the field you want the number to show in and 1 is where you would put the value you want when the user clicks that button

Avatar

Level 10

Hi,

Another method is to put a single script in the click event of the radio button exclusion group. In the hierarchy, this is the container for all of the related radio buttons.

The script click event would look like:

NumericField.rawValue = this.rawValue;

Then with the radio button exclusion group selected, go to the Object > Binding palette and tick Specify Item Values. Type into the panel the value of each of the individual radio buttons.

Parallels Desktop1.png

Hope that helps,

Niall

Avatar

Level 1

Thank you Niall & whyisthisme. (sorry for the delay since your response but I had to go out of town) I'm not sure I understand where to place the calc script - is it at the numeric field box? I actually had gone into the button exclusion groups and specified the values, but I still can't get what is selected to pop up in my numeric field. Would it be possible for me to send you a pic of my doc so you can see where I am trying to populate that calculation?

Jen

Avatar

Level 10

Hi Jen,

The script in my example would go in the click event of the radio button exclusion group. This is the container that groups all of the radio buttons.

You would just need to replace "NumericField1" with the reference to your numeric field object.

Hope that helps,

Niall

Avatar

Level 1

Thank you for responding Niall. I don’t see anything labeled “click event”, I think that is my problem.

I want the button clicked to show up in the Cost numeric field under this table of buttons.

Is there somewhere else I access that?

Jenn

Avatar

Level 10

Hi Jen,

I can't see the image. If you want to include images you would need to post them online (via email wont work).

In any case here is an example: https://acrobat.com/#d=qE1IszHcL6589QQYB7ceGg.

Parallels Desktop1.png

Hope that helps,

Niall

Avatar

Level 1

I don't seem to have those same fields....attached is the pic I tried to send earlierRadioButtonTest.jpg

Avatar

Level 10

Hi Jen,

I would recommend that you amend your workspace in Designer. You can show/hide palettes from the Window menu.

Here are some pointers (which are optional):

LC Designer Workspace.png

  1. This is the hierarchy palette and is very handy when working with forms. You can select objects quickly and drag objects around.
  2. This is the Object palette, which makes it easy to drag objects onto the page.
  3. The main space with tabs for Design View, Master Pages, XML Source (you should not need this) and Preview.
  4. You can select objects in EITHER the page or the hierarchy view and then change properties in other palettes.
  5. The Script Editor is very important when you start to add functionality to your form. It is visible on your screen shot, but it is limited to one line in height. So I would recommend that you drag this down so that you can see a few lines of script. The Show dropdown in the Editor allows you to look at the script in various events. In the example I posted, there is script in the click event.
  6. Object palette (and Font & Paragraph palettes). These will allow you to make changes to various properties, depending on the object that is selected.

You will see from the screenshot that you can position and stack the palettes to suite your screen and workflow.

Now, in relation to your screenshot:

  • You have selected a single radio button in your group. You need to select the whole exclusion group, this is easy in the hierarchy palette.
  • In the Object > Binding palette you have ticked the Specify Item Values (good), but you need to edit the values to match the Display Items. For example for item "$85", the specified value should be "85".

For starters, I would recommend that you open a few of the palettes and then have a look at my example and the screenshots. Hopefully that will clear it up for you.

Niall