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
Bedrock Mission!

Learn more

View all

Sign in to view all badges

make a subform a read only


Level 2

Hi all,

I'm new to scripting, a sample code will help.

I have a form with three subforms in it. One subform (subform1) contains radio buttons, radiobutton1 & radiobutton2. When radiobutton1 is selected, I need to disable subform 2 and all its elements. Same thing when selected radiobutton2, subform3 and all its elements are disabled.

How do I do this?

Any response is helpful.



6 Replies


Level 10

The radio buttons will be part of a RadioButton group. On the change event of that group you will add your code there. If you query the group object it wil return the value of the button that is selected. So if you have one button for Yes and one button for  No (and you have set them up to return those values, then you can use code something like this:

if (this.rawValue == "Yes"){

   subform2.presence = "hidden";

} else {

   subform2.presence = "visible";


You can also set the presence to invisible and the subform space will still be there (blank of course). Hidden will exclude the subform from the layout and if the form is created properly will reflow so there is no blank space. Make sure to save your form as a dynamic form.



Level 2

Thanks Paul.

With  your script, it hides the subforms with a selection of a radiobutton.

I don't want the subforms to be invisible. I need to just disable the elements in the subform.

I tried your code that you have sent me by I can't figure it out (dumb to scripting, especially the "for loop").



Level 10

The code is set up to accept a subform and will lock everything in that subform. So you shoudl be able to make a call to the scriptobject and pass the subform name (complete path) that you want to lock so something like this (your path will be different). The original command looked like this:


Modify to look like this:


Make sense?