hi ,
I am developing a system using javascripts and ajax.
I am retrieving data from database and bind them in an html table. I am using a for loop to do this. This table has one column of html buttons. my task is to call a function when a user press the button in a row. this function will call an ajax method to bring some data fro the database. I have to pass a value to this function when a user press the button. this value is unique to each raw.
this is the part code i am trying;
[CODE=javascript]// in the for loop
btn=document.cr eateElement('IN PUT');
btn.type='butto n';
btn.value=Dset. value.Tables[0].Rows[a].CusCode;
btn.onclick=fun ction CustomerClick()
{
// function will bring data
};
//
[/CODE]
this is the place i got the problem. I want to pass that 'CusCode' value to the function as avariable. this 'CusCode' is unique to each raw. when the user press the button it should call the function with it's unique variable.
can anyone help me to solve this?
I am developing a system using javascripts and ajax.
I am retrieving data from database and bind them in an html table. I am using a for loop to do this. This table has one column of html buttons. my task is to call a function when a user press the button in a row. this function will call an ajax method to bring some data fro the database. I have to pass a value to this function when a user press the button. this value is unique to each raw.
this is the part code i am trying;
[CODE=javascript]// in the for loop
btn=document.cr eateElement('IN PUT');
btn.type='butto n';
btn.value=Dset. value.Tables[0].Rows[a].CusCode;
btn.onclick=fun ction CustomerClick()
{
// function will bring data
};
//
[/CODE]
this is the place i got the problem. I want to pass that 'CusCode' value to the function as avariable. this 'CusCode' is unique to each raw. when the user press the button it should call the function with it's unique variable.
can anyone help me to solve this?
Comment