0
:プラグイン ホームページ:LinkJQuery:計算プラグインが合計価格に計算されません
:javascriptの
$("[id^=total_price_ht]").calc(
// the equation to use for the calculation
"qty * price",
{
qty: $("[id^=unit_quantity_]"),
price: $("[id^=unit_price_ht_]")
},
function (s){
// return the number as a dollar amount
return "$" + s.toFixed(2);
}
);
:HTML
<tr id="lines[0]">
<td>
<input id="0" type="checkbox" class="hiddenCheckbox">
<label for="0" class="prettyCheckbox checkbox list"><span class="holderWrap" style="width: 18px; height: 19px; "><span class="holder" style="width: 18px; "></span></span></label>
</td>
<td>
<input class="required" name="lines[0][title]" placeholder="Title" type="text">
</td>
<td>
<input name="lines[0][description]" placeholder="Description" type="text">
</td>
<td>
<input class="required" id="unit_quantity_0" name="lines[0][quantity]" placeholder="Quantité" type="text" value="0,00">
</td>
<td>
<input class="required" id="unit_price_ht_0" name="lines[0][unit_price_ht]" placeholder="Prix unit. HT" type="text" value="0,00">
</td>
<td class="price" id="total_price_ht_0">$0.00</td>
</tr>
ページがロードしたら、私はtotal_price_htフィールドに「$ 0.00" 見ることができますが、それは価値が時に変更されないのです数量または価格を変更します。
私は間違っていますか?ありがとう。
は、あなたが生成されたHTMLを投稿してもらえますか? –
@AndrewWhitaker生成されたHTMLを投稿しました。ありがとう。 – Laura
ありがとうございます - これは使用しているプラグインですか? http://www.pengoworks.com/workshop/jquery/calculation/calculation.plugin.htm –