請求書の合計を計算する必要があります。この請求書は、フォーム、金額、数量、税のフィールドで作成され、フィールドの合計は cfinput のバインドで作成されます。すべての行の合計、合計を作成できません。いくつかの操作を試みましたが、解決に至りませんでした
これはコード例です:
<cfform action="" method="post">
<cfloop from="1" to="3" index="i">
Q.ta <cfinput type="text" name="quantita#i#" value="0">
+
Importo <cfinput type="text" name="importo#i#" value="0">
+
Tax <cfinput type="text" name="iva#i#" value="0">
=
Totale <cfinput type="text" name="totale#i#" value="0" bind="cfc:somma.getSomma({quantita#i#},{importo#i#},{iva#i#})">
<br /><br />
</cfloop>
フロン:
<cfcomponent>
<cffunction name="getSomma" access="remote" returntype="string">
<cfargument name="quantita" default="0">
<cfargument name="importo" default="0">
<cfargument name="iva" default="0">
<cfset totaleSomma=#evaluate((importo*quantita)*(1+iva))#>
<cfreturn totaleSomma>
</cffunction>
</cfcomponent>