Link to home
Start Free TrialLog in
Avatar of Westside2004
Westside2004Flag for United States of America

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
ASKER CERTIFIED SOLUTION
Avatar of daohailam
daohailam
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Westside2004

ASKER

Thanks,

-ws