When writing a method to change bulk properties the best way to do it is using the index
for ( var i = 1 ; i < 5 ; i++ ){
elements*.visible = false;*
- }*
There should be another field in the properties dialog for each form element “index id” Then we can organize and block out fileds that we want to make disabled or invisible.
wgknowles:
When writing a method to change bulk properties the best way to do it is using the index
for ( var i = 1 ; i < 5 ; i++ ){
elements*.visible = false;*
- }*
[/quote]
I think what you are looking for is the following code. It uses an array where you can set as many items as you’d like and you can identify them by name.
```
*var myArray = new Array(‘btnSend’,‘bulkbutton’,‘email’,‘emailBorder’)
for ( var i = 0 ; i < myArray.length ; i++ ){
var theItem = myArray[i];
elements[theItem].visible = false;
}*
```
I think what you might be asking for, which would be really powerful is a function like forms.formName.controller.elementList() where the return result would be an array of all the element names for a given form.
You would then use regex to filter out the elements you did or did not want. For example, as a programming practice you could prefix all buttons with the prefix ‘btn’ (such as btn_sendEmail) you could then optionally affect only those items by pairing down the array of all elements to only those you want. Now that would be a nice function.
How about it Servoy devs? a controller.elementsList() function? You could return as an array or a return delimited string (which could be made into an array with a .split function) ![Wink :wink:]()
![Smile :)]()
var elementsArray = new Array()
for(var i=0 ; i<elements.length ; i++)
{
elementsArray[i] = elements[i].getName()
}