Expand my Community achievements bar.

SOLVED

EASY Question for the Weekend

Avatar

Level 3

HI,

Let's say I have a subform with five text fields in it. I want to put a button into the form and when I click the button, I want it to make all five text fields "protected". Is there a way to address all five text fields as a single entity so that I only have to write one line of code to protect them all?

Instead of saying textfield1.access = "protected"; textfield2.access = "protected"; textfield3.access = "protected"; and so on...

I would rather say textfield_group.access = "protected";

Do "groups" work like that or is there a better way to do this?

Thanks,

Joe

1 Accepted Solution

Avatar

Correct answer by
Former Community Member

If you wrap the five fields in a subform, then set the subforms access to readOnly then that setting will be set for all child objects of the subform.

Paul

View solution in original post

2 Replies

Avatar

Correct answer by
Former Community Member

If you wrap the five fields in a subform, then set the subforms access to readOnly then that setting will be set for all child objects of the subform.

Paul

Avatar

Level 3

Thanks Paul!!!

Yah...I have been coding for a long time today and I am getting punchy. This is not the type of work I usually do.

Should have thought of this myself.

Joe

The following has evaluated to null or missing: ==> liqladmin("SELECT id, value FROM metrics WHERE id = 'net_accepted_solutions' and user.id = '${acceptedAnswer.author.id}'").data.items [in template "analytics-container" at line 83, column 41] ---- Tip: It's the step after the last dot that caused this error, not those before it. ---- Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign answerAuthorNetSolutions = li... [in template "analytics-container" at line 83, column 5] ----