Expand my Community achievements bar.

Mutually Exclusive Selection

Avatar

Level 1

With either radio buttons or checkboxes I would like to make the following script:

If CheckBox1 ==1 then "place this text inside separate text object" else "leave the separate text object blank.  I've created the logic on the calculate, click, enter, mouseup and mousedown events but none seem to work.  What I'm trying to achieve is two things:

1) allow only one box (in the set of two) to be checked/selected, and

2) have the value in the separate text box only show up if that box is checked.

I can get # 2 to happen but the value stays there after you initially select one of the boxes...

Please help.  (I've attached the file I'm referring to and this logic is in Text193 and Text194 on page 2.

2 Replies

Avatar

Level 10

Hi,

That is quite a complex form!

You were nearly there with the script. A few sticking points:

  • When you have multiple objects with the same name, it makes it more difficult to reference them in script. So I would recommend naming objects as you go;
  • Your had double .. in the SOM and the reference was incomplete;
  • To make radiobuttons exclusive they need to be in the same exclusion group. I dragged 197 into the 196 group. In the binding tab for the exclusion group I assigned 196=1 and 197=2. I then amended the script:

If(topmostSubform.Page2.RadioButtonList196==1) then "paid directly to seller"  else "" endif

Here is the form.

Lastly, I would recommend that you use the captions of the objects as much as you can. This will cut down on the number of separate objects that have to be rendered and trying to lay them out at design. Also tabbing is significantly affected by the relative x,y coordinates of objects. So where objects are not aligned the tabbing may be erratic. Also grouping sections in subforms helps organise the form and will tab through that subform before going to the next object.

Hope that helps,

Niall