This works: elements.element_name.bgcolor = ‘#CCDDAA’;
This does not work: elements[0].bgcolor = ‘#CCDDAA’;
I get the impression from the manual that something like this is doable. Is it a bug at the moment or am I doing something wrong?
- david
This works: elements.element_name.bgcolor = ‘#CCDDAA’;
This does not work: elements[0].bgcolor = ‘#CCDDAA’;
I get the impression from the manual that something like this is doable. Is it a bug at the moment or am I doing something wrong?
It’s indeed a bug
dev team is solving this.
Since this can be a HUGE timesaver writing code, here’s a script example for all readers to clarify this subject a bit.
(BTW I tested this code with build 257, and it should work)
Assume you have a form with 2 textfields and 8 scriptbuttons that can set both the textfields along with some generic code.
(it’s a bit hypothetical, but the concept applies to many other situations)
Scripts would look like this:
script1
1)…show dialog
2)…do a lot of checks
3)textfield1 = “button1Click setting textfield1”
4)textfield2 = “button1Click setting textfield2”
script2
1)…show dialog
2)…do a lot of checks
3)textfield1 = “button2Click setting textfield1”
4)textfield2 = “button2Click setting textfield2”
etc, etc…
This is NOT what you want, if you have to change something in the generic code. (changing dialogtext, would have to be done in 8 different scripts. Extra annoying, knowing that it’s 8 times the same change you have to do.)
So…given the situation, here’s the way you would want to go:
Make one generic script that looks like this:
genericScript
var textField1Content = arguments[0]
var textField2Content = arguments[1]
1)…show dialog
2)…do a lot of checks
3) textfield1 = textField1Content
4) textfield2 = textField2Content
…the other 8 scripts would look like this:
script1
script2
etc,etc…
diabolic