Hi,
Simple question here. How do you use a variable inside another variable name?
Example:
function enableMe(form,button) {
document.form.button.disabled=false;
}
In this example I would be passing a form name (form), and a button name (button) to the function as an argument. How do you insert those 2 variables into the "document.form.button.disabled=false;" statement? The way it is obviously does not work, because the function looks for a form named "form" and a button named "button" and they do not exist.
If I were to try something like:
"document.[form].[button].disabled=false;"
There is a JScript error about "Object Expected". I'm thinking it's because the [form] and [button] are not evaluated, but I don't know why.
Any advice/help is great!
Many thanks
Maniax