Westside2004
asked on
Dynamic onClick and passing a parameter to the function??
Hi,
I am trying to change the onClick of this button dynamically. Initially the button says "edit", when you click "edit" I redefine some of the properties of the button
function editFunction(currentRow, someId) {
editButton.id = 'btnSave' + currentRow;
editButton.name = 'btnSave' + currentRow;
editButton.value = 'Save';
editButton.onclick = saveFunction;
}
function saveFunction(someId) {
alert(someId)
}
Hope that makes sense, basically I am just trying to get the variable which is passed into editFunction() to be available to the saveFunction.
-ws
I am trying to change the onClick of this button dynamically. Initially the button says "edit", when you click "edit" I redefine some of the properties of the button
function editFunction(currentRow, someId) {
editButton.id = 'btnSave' + currentRow;
editButton.name = 'btnSave' + currentRow;
editButton.value = 'Save';
editButton.onclick = saveFunction;
}
function saveFunction(someId) {
alert(someId)
}
Hope that makes sense, basically I am just trying to get the variable which is passed into editFunction() to be available to the saveFunction.
-ws
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
-ws