如何使用jquery在列表列表中添加默认值以在文本框中显示 [英] how to add default values in list of column to display in textbox using jquery

查看:49
本文介绍了如何使用jquery在列表列表中添加默认值以在文本框中显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

想要在列值中添加默认值并使用jquery自动显示在AMOUNT文本框中

我正在做学校项目。我想添加(费用,学费,学期费,公交费) )这些值在选择学生后从服务器重新获得。这些值在金额列中计算并自动显示在TOTAL文本框中。

In want to add default values in column values and display automatically in AMOUNT textbox using jquery
I am doing school project.i want to add(fee,tution-fee,term fee,bus fee)these values retrived from server,after selecting the student.these values calculated in amount column and automatically display in TOTAL textbox.

推荐答案

Try this, i hope this is helping you
<!-- JQuery -->
<script type="text/javascript" src="http://code.jquery.com/jquery-1.10.1.js"></script>

<!-- Html -->
Other Fee : <input type="text" id="amnt1" class="fee" name="otr_fee" value="0"><br>
Tution Fee : <input type="text" id="amnt2" class="fee" name="tution_fee" value="0"><br>
Term Fee : <input type="text" id="amnt3" class="fee" name="term_fee" value="0"><br>
Bus Fee : <input type="text" id="amnt4" class="fee" name="bus_fee" value="0"><br>
Total : <span id="total"></span>

<!-- Jquery -->
<script type="text/javascript">


(window).load(function(){
(window).load(function(){


(。fee)。bind('input',function(){
var txt =
(".fee").bind('input', function(){ var txt =


这篇关于如何使用jquery在列表列表中添加默认值以在文本框中显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆