http://img26.imageshack.us/img26/4043/listview.png[
^]
onkeypress was not valid attribute so I used onkeydown.
I have tried your javascript function but it displays nothing
*I have 0 values on my textbox fields as default
*the function is being called but does nothing
I dont get this one, do I have to substitute values for this one?
does obj stands for the listview1(name)?
please explain. thanks.
var tr=obj.parentNode.parentNode
this is the present javascript I have
<script type="text/javascript" language="javascript">
function CalculateValue(obj)
{
var tr=obj.parentNode.parentNode //get the entered row object.
var txtPopu=tr.cells[2].getElementByTagName("INPUT")[0] //population textbox
var txtMale=tr.cells[3].getElementByTagName("INPUT")[0] //male textbox
var txtFemale=tr.cells[4].getElementByTagName("INPUT")[0] //female textbox
var txtTotal=tr.cells[5].getElementByTagName("INPUT")[0] //total textbox
var txtPercent=tr.cell[6].getElementByTagName("INPUT")[0] //percentage textbox
txtTotal.value=parseInt(txtMale.value) + parseInt(txtFemale.value); //total value calculation.
txtPercent.value= (parseInt(txtTotal.value) / parseInt(txtPopu.value)) * 100 //percentage calculation.
}
</script>