Can you put an eval() function on left side of comparison

Hello Guys,

I want to variable set fields(of selected record from form) and elements on different forms using one method.

Is this possible?

When I use this code I get a validation errormessage “Invalid assignment left-hand side”.

eval('forms.' + GT_FormName + '.elements.counter.bgcolor') = '#ff9999'
eval('forms.' + GT_FormName + '.counter') = GI_Counter

When I use this code I get a validation errormessage “missing name after . operator”.

forms.[GT_FormName].counter = GI_Counter

Is there any other way to do this without having to use lots of if statements?

Thanks in advance

kind regards Rene

forms.[GT_FormName].counter = GI_Counter

should be:

forms[GT_FormName].counter = GI_Counter

Paul

Thanks Paul,

I get the point :wink: .

This works like a charm. Much neater than an eval function.

With Kind Regards Rene.