Sum on live text box value using jQuery
<p>I am trying to grab total/sum value of all <code>.totalfee</code> input boxes, i am using following jquery code...</p>

<pre><code>$(document).ready(function () {
    $('#instal').bind('textchange', function (event, previousText) {
        var instalval = parseInt($(this).val());
        if ($('#fields').children().hasClass('inputs')) {
            $('.inputs').remove();
        }
        if (instalval != '') {
            for (i = 0; i &lt; instalval; i++) {
                $('#fields').append('&lt;li class="inputs clearfix"&gt;&lt;input type="text" class="small date" size="30" name="payment[date][]" placeholder="Date" /&gt; &lt;input type="text" class="xsmall rfee" size="30" name="payment[regfee][]" placeholder="Reg. Fee" /&gt; &lt;input type="text" class="xsmall tfee" size="30" name="payment[tutfee][]" placeholder="Tut. Fee" /&gt; &lt;input type="text" class="small totalfee" size="30" name="payment[total][]" placeholder="Total" /&gt; &lt;span title="Remove this" class="ui-icon ui-icon-closethick closefield"&gt;&lt;/span&gt; &lt;/li&gt;');
                $(".rfee,.tfee").keyup(function () {
                    var $li = $(this).closest("li");
                    var rfee = parseFloat($li.find(".rfee").val());
                    var tfee = parseFloat($li.find(".tfee").val());
                    if (isNaN(rfee)) rfee = 0;
                    if (isNaN(tfee)) tfee = 0;
                    $li.find(".totalfee").val(rfee + tfee);
                });
                $(function () {
                    $(".date").datepicker({
                        //minDate: "+" + i.toString() + "M", 
                        dateFormat: 'yy-mm-dd'
                    });
                });
            }
        }
    });
    $('.closefield').live('click', function () {
        $(this).parent().remove();
    });
});
</code></pre>

<p>I just want to get sum value of total installments (in #instotal) for validation purpose. My form as follows...</p>

<pre><code>&lt;p&gt;
&lt;label for="netpay"&gt;Net Payable&lt;/label&gt;
 &lt;input type="text" class="medium" size="50" name="netpay" id="netpay" &gt;
&lt;/p&gt;
&lt;div class="clearfix"&gt;&lt;label for="intal"&gt;Installments&lt;span class="alert"&gt; *&lt;/span&gt;&lt;/label&gt;
 &lt;!--min="1" --&gt;&lt;input type="number" max="36" step="1" value="0" size="20" class="xsmall" id="instal" name="instal" &gt; &lt;span class="txt"&gt;Months&lt;/span&gt;&lt;br class="fix" /&gt;
 &lt;ul id="fields"&gt;
 &lt;/ul&gt;
&lt;p&gt;Total: &lt;span id="instotal"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
</code></pre>

<p>hello, thanks for quick reply, i am very confused, what code should i add to match value of sum(.totalfee) with #netpay, i hope that makes sense. as above code is for creating installment plan, and i don't want more installments than net pay.</p>
