use var imdesc = document.myform[imagename1].value
not var imdesc = eval("document.myform." + imagename1 + ".value")
but i could not see how to change mine to emulate it...
I have a function displaytable() which i pass the id of a div into so:
displaytable(MyLayer1) - shows the first table hidden in the <div id=MyLayer1>
displaytable(MyLayer2) - shows the second table etc
So in my updatetemplate function I used eval to pass the string version of the object when the relevent menu item is selected:
Expand|Select|Wrap|Line Numbers
- function updatetemplate()
- {
- var dropdown = document.form1.template;
- var thenumber = dropdown.options[dropdown.selectedIndex].value;
- eval ( 'displaytable(MyLayer' + thenumber + ')' )
- }
The function then passes the object and changes its display method
Expand|Select|Wrap|Line Numbers
- function displaytable(xxx)
- {
- xxx.style.display = "block"
e.g. i tried this to no avail .. just get "expecting object" error:
Expand|Select|Wrap|Line Numbers
- var convertit = document.['MyLayer'+thenumber]
- displaytable( convertit ) ;