从1个输入

时间:2016-06-12 20:54:25

标签: javascript html forms paypal

我通常在VBScript中工作,但我试图用一些javascript帮助朋友,并且我一直在遇到语法错误。我正在使用PayPal链接,并且我尝试根据数量字段更新金额。

Javascript部分:

<script language="javascript">
function updateQTY() {
   var Qty = document.getElementByID('quantity');
   var vshowCost = document.getElementByID('showCost');
   var vpostCost = document.getElementByID('postCost'); 
   vshowCost.value=parsefloat(Qty.value)*100;
   vpostCost.value=parsefloat(Qty.value)*100;
   return 1;
}​
</script>

HTML表单代码:

<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post" name="consulting" id="consulting">
    <tr class="StoreFront">
        <td class="StoreFront">
            <b>Consulting
            <br/>
            <input type="text" name="quantity" id="quantity" size="4" onchange="updateQty();" value="2">
            Cost: $<input type="text" name="showCost" id="showCost" value="200" size="8" readonly>CAD
        </td>
        <td class="StoreFront" valign="top" width="130px">
            <input type="image" src="https://www.paypal.com/en_US/i/btn/btn_cart_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
            <img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
            <input type="hidden" id="postCost" name="amount" value="0.00">
            <br/>
        </td>
    </tr>
</form>

我在结束大括号时收到无效的令牌错误。有什么想法吗?

1 个答案:

答案 0 :(得分:2)

您应该知道Javascript区分大小写。你的javascript函数有很多错误。试试吧:

int [,] image2D;