Not technically a Canvas question.
I am returning a field name and field value from a database query. What I want to do is set the value of the field on the HTML form to the value returned. I can build the field name but I can’t seem to then use that field name to set the value. See the code below.
field = “document.enteredValues.” + response.DATA[i][2] + k.toString();
field.value = response.DATA[i][3];
The field value resolve to something like document.enteredValue.draglineOB1
In JavaScript normally document.enteredValue.draglineOB1.value = 12 would normally work.
I have tried to use the eval(), but JavaScript does not like on the left hand side of a function.
Brian