开发者

How to find textbox value in JavaScript

开发者 https://www.devze.com 2023-02-07 03:51 出处:网络
I am working on one project where I need to create an order form I got a very good example from http://css-tricks.com/examples/DynamicOrderForm/.

I am working on one project where I need to create an order form

I got a very good example from http://css-tricks.com/examples/DynamicOrderForm/.

But the problem is that the pricing here is fixed, but I need a textbox for pricing so I can change p开发者_如何学运维ricing also.

I tried to make it work, but failed.

Thanks for your help.


go down and search for

<td class="price-per-pallet">$<span>165</span></td> 

and edit the prices within the "span" tag with your price. If you want a textbox

<input name="price" type="text" />

then in order.js check where the calculations are being taken place and there you can read the value of this textbox instead of reading static value of span tag. Find following line in order.js

// Find the pricing
        var multiplier = $el
            .parent().parent()
            .find("td.price-per-pallet span")
            .text();

instead of

.find("td.price-per-pallet span").text();

you can use

.find('td.price-per-pallet span input[name="price"]').val();

Hope this helps

0

精彩评论

暂无评论...
验证码 换一张
取 消