S
Steve Neill
Here's an intersting problem...
I have a JS object that has a property: "fullname"...
myObject.client.name.fullname = "John Smith";
I also have a corresponding DOM element with an "id" value set to
"client_name_fullname":
<input type="text" id="client_name_fullname">
When the DOM element detects an "onkeyup" event I wish to change the
JS object property value accordingly.
If hard-coded, I might express this change as:
myObject.client.name.fullname = { DOM element value }
or
myObject["client"]["name"]["fullname"] = { DOM element value }
However, if all I have is the DOM element id expressed as a string
value, how would I update the JS object value? Furthermore, I want to
do this WITHOUT resorting to the eval() function.
Any ideas?
I have a JS object that has a property: "fullname"...
myObject.client.name.fullname = "John Smith";
I also have a corresponding DOM element with an "id" value set to
"client_name_fullname":
<input type="text" id="client_name_fullname">
When the DOM element detects an "onkeyup" event I wish to change the
JS object property value accordingly.
If hard-coded, I might express this change as:
myObject.client.name.fullname = { DOM element value }
or
myObject["client"]["name"]["fullname"] = { DOM element value }
However, if all I have is the DOM element id expressed as a string
value, how would I update the JS object value? Furthermore, I want to
do this WITHOUT resorting to the eval() function.
Any ideas?