function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Amit_Amit_ 

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_

Amit_Amit_

I found out my mistake I forgot to add the method name in my onChange event.

 

thanks

Amit_