I wrote this code for a check box object that, once clicked, will check other box objects at once:
javascript, change:
if (this.rawValue == 1) {
S1.rawValue = 1;
S2.rawValue = 1;
}
it works.
Then I wanted to simplify the script by renaming my objects and tried this:
if (this.rawValue ==1) {
S[*].rawValue = 1;
}
doesn't work... T_T
syntax error? have to do a variable? scratching my head. help.
Many thanks in advance!
Solved! Go to Solution.
Views
Replies
Total Likes
This script should do the trick.
var iSel = this.rawValue,
oFields = this.resolveNodes("#field[*]");
for (var i = 0; i < oFields.length; i += 1) {
oFields.item(i).rawValue = iSel === 1 ? 1 : null;
}
Views
Replies
Total Likes
Hi there,
to do this, you must use resolveNode to apply changes to all different objects.
This approach may be accepted if you use FormCalc instead of JavaScript, but syntax would be different.
To use the resolveNode method, you should try it this way :
This should do the trick.
I hope this help.
Views
Replies
Total Likes
Thank for checking!
Unfortunately, I'm getting a syntax error on the 3rd line.
Also, no idea what I'm reading..oLen.. I++... I'm not a programmer by any stretch.
None the less, I'm looking up resolve Nodes now.
Views
Replies
Total Likes
This script should do the trick.
var iSel = this.rawValue,
oFields = this.resolveNodes("#field[*]");
for (var i = 0; i < oFields.length; i += 1) {
oFields.item(i).rawValue = iSel === 1 ? 1 : null;
}
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies