Hi,
I created a datagrid dynamically. My datagrid contains two columns template: one is a checkBox column template the second is a LinkButton column template.
I want to get ([b]in javascript[/b]) the values of the linkbutton for all selected checkbox.
I have created a function the iterates throught the selected chekbox. But i am not able to read the corresponding value in the linkbutton.
Can someone help me?
here is my code javascript:
[code]
function CountCheck()
{
var counter = 0;
var counter_checked = 0;
var objForm = document.forms[0];
for(i=0; i < objForm.length; i++)
{
alert( objForm.elements[i].type+': '+objForm.elements[i].name);
if (objForm.elements[i].type == 'checkbox')
{
if (objForm.elements[i].checked == true)
{
counter_checked++;
}
counter++;
}
}
alert(''You have '' + counter + '' checkboxes, '' + counter_checked + '' are checked...'');
}
[/code]
I tried this instruction to get the corresponding linkbutton object:
if (objForm.elements[i].type == 'LinkButton')
But it deos not work.
but it works if the type is checkbox!!
Thank you in advance.