Hi All,
In the following script I am using a variable named "template" passed through the function as a portion of an element id.
PHP Code:
function switchTemplate(template, name) {
if (name == 'Header0')
{
template.value=document.theform(name).value;
document.all.Selected + template + ID.value='Template Name';
document.all.NewHeaderDiv.style.display='inline';
document.all.SelectedHeaderDiv.style.display='none';
doRenderHTML();
}
else
{
template.value=document.theform(name).value;
document.all.NewHeaderDiv.style.display='none';
document.all.SelectedHeaderDiv.style.display='inline';
document.all.SelectedHeaderID.value=document.theform(name).id;
doRenderHTML();
}
}
The attempt to use the variable is on this line:
PHP Code:
document.all.Selected + template + ID.value='Template Name';
For example if template = Header, I need the above code to output:
PHP Code:
document.all.SelectedHeaderID.value='Template Name';
How do I properly use the variable "template" in this situation?
Thanks in advance,
David
Bookmarks