You need to sign in to do that
Don't have an account?
Problem in displaying pageblock table values using Javascript
Hi all,
I am facing some starnge problem I dont know why my values are not populating on pageblocktable. I am using JavaScript this is my Js :
<script>
function computeTotal(quantityId,unitPriceId,totalId){
alert('JS being Called');
var quantity = document.getElementById(quantityId).value;
var cost = document.getElementById(unitPriceId).innerHTML;
var totalPrice = quantity * cost ;
document.getElementById(totalId).innerHTML = totalPrice;
}
</script>
and i am calling this JS method form pageblocktable
<apex:column headerValue="Quantity" >
<apex:inputtext value="{!tmpVar.quantity }" onChange="('{!$Component.quantityId}','{!$Component.unitPriceId}','{!$Component.totalId}')" id="quantityId"/>
</apex:column>
<apex:column headerValue="total">
<apex:outputText id="totalId"/>
</apex:column>
But i dont know why the values are not populating in my Total column field.
any suggestion and help will be great help to me.
Thanks & Regards,
Amit_
I found out my mistake I forgot to add the method name in my onChange event.
thanks
Amit_