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
Saikiran KolliSaikiran Kolli 

Unable to add values into a variable

Hi,

I'm adding apex:outputtext values into variable to compare , but unable to execute please help me
 
<script>
 function sound()
            {
                var i= '{i.OrdlItem.Supplied_Quantity__c.size()}';
                var j ='{ord.Supplied_Quantity__c.size()}';
                if(i>j){
                    alert('value increased');
                }
</script>


    <apex:dataTable value="{!orderItemsList}" border="1" var="ord" id="theTable" rowClasses="odd,even" styleclass="outBorder" width="550px" rendered="{!orderItemsList.size>0}">

  </apex:column>
        <apex:column styleclass="inBorder" >
            <apex:facet name="header">Supplied Quantity</apex:facet>
            <apex:outputText value="{!ord.Supplied_Quantity__c}"/>
        </apex:column>


 <apex:pageBlockTable value="{!ListItem}" var="i">
<apex:column headerValue="Supplied Quantity">
                    
                  
                            <apex:outputText value="{!i.OrdlItem.Supplied_Quantity__c}" />

 
PavanKPavanK
function sound()
            {
                var i= '{i.OrdlItem.Supplied_Quantity__c}';
                var j ='{ord.Supplied_Quantity__c}';
                if(i.value>j.value){
                    alert('value increased');
                }
</script>
Can you please try with above code.
 
sathishkumar periyasamysathishkumar periyasamy
where sound() javascript method called in your code? look like you are using data table and pageblocktable, you may more than one rows. That's why.
Saikiran KolliSaikiran Kolli
pavan, its not working
Saikiran KolliSaikiran Kolli
satish, totaly 4 rows are there but only supplied quanitity will be changed, so sound/alert message must be produced if they scan more than required books.