K
kusanagihk
To all,
I'm working on a javascript to dynamic build a common set of HTML
controls.
01) I've used the DOM object to build a <div> tag; then build 1 <input
type='button'/> and 1 <input type='text'> object
02) by using appendChild () method, I've successfully append the button
and the textbox under the div tag (or container in this case)
03) but now I would like to add the javascript onclick event on the
button I've just created...
Problem:
I've managed to add the required Javascript function by this syntax:
aButton.onclick=onclickHandler;
but I can't figure out how to pass in the parameters to the
function!!!! For example I need to pass in a string to identify the
required data format for validation in the onclickHandler function....
I urgently need a work around or the actual way to pass in parameters
to the function dynamically.
Thx!
I'm working on a javascript to dynamic build a common set of HTML
controls.
01) I've used the DOM object to build a <div> tag; then build 1 <input
type='button'/> and 1 <input type='text'> object
02) by using appendChild () method, I've successfully append the button
and the textbox under the div tag (or container in this case)
03) but now I would like to add the javascript onclick event on the
button I've just created...
Problem:
I've managed to add the required Javascript function by this syntax:
aButton.onclick=onclickHandler;
but I can't figure out how to pass in the parameters to the
function!!!! For example I need to pass in a string to identify the
required data format for validation in the onclickHandler function....
I urgently need a work around or the actual way to pass in parameters
to the function dynamically.
Thx!