Hello,
Serverside I'm generating a html page.
There are different controls for which I want to create an
eventhandler manually.
Like:
document.forms[0].TextBox1.onchange = EventHandler;
document.forms[0].Button1.onclick = EventHandler;
function EventHandler(){
// do something
}
What I would like is to pass arguments to the Eventhandler.
Like:
document.forms[0].TextBox1.onchange = EventHandler('test1');
document.forms[0].Button1.onclick = EventHandler('test2');
function EventHandler(inp){
// do something conditioned by parameter.
}
This sample is simplified, additional, in the EventHandler I'll
execute the original eventhandlers which I'm gonne store in a
variable.
So, the question:
Is it possible to have an eventhandler with parameters? or should I
create an eventhandler for all controls which need some extra dynamic
behavior?
By the way, Yes, I know I can simply use <input type="text"
id="TextBox1" onclick="DoFunction();" />
But that's not what I want in this case.
Thanks in advance!
Remco