如何计算蒙面文本框字段? [英] How to calculate a masked textbox field?
本文介绍了如何计算蒙面文本框字段?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个网页表单,其中包含用于计算的文本框。我有两个文本框用于减少,三个用于添加。我正在使用jquery来屏蔽文本框以获取金钱价值。文本框可以解决被遮挡的问题。文本框的计算是正确的。我刚刚将jquery添加到代码中以掩盖文本框,它可以工作,但计算已停止工作。我该如何解决这个问题?
掩蔽代码:
I have a web form that has textboxes for calculation. I have two textboxes for subtration and three for adding. I am using jquery to mask the textboxes for money value. THe textboxes work with out the masked being there. The calculation is correct for the textboxes. I just added the jquery to the code to mask the textboxes and it works but the calculations has stopped working. How can I fix this?
Masking code:
<script src="Scripts/jquery-2.1.1.min.js" type="text/javascript"></script>
<script src="Scripts/jquery.maskMoney.js" type="text/javascript"></script>
<script type='text/javascript'>
$(document).ready(function () {
$("#TextBoxTROA").maskMoney();
$("#TextBoxInstr").maskMoney();
$("#TextBoxRes").maskMoney();
$("#TextBoxPubS").maskMoney();
$("#TextBoxAcad").maskMoney();
$("#TextBoxStudS").maskMoney();
$("#TextBoxInstiS").maskMoney();
$("#TextBoxOperM").maskMoney();
$("#TextBoxAuxE").maskMoney();
$("#TextBoxHosS").maskMoney();
$("#TextBoxLYIndeO").maskMoney();
$("#TextBoxOED").maskMoney();
$("#TextBoxTA").maskMoney();
$("#TextBoxTL").maskMoney();
$("#TextBoxTUNA").maskMoney();
$("#TextBoxETRNA").maskMoney();
$("#TextBoxNPRNA").maskMoney();
$("#TextBoxTR").maskMoney();
$("#TextBoxTFN").maskMoney();
$("#TextBoxCD").maskMoney();
$("#TextBoxLTD").maskMoney();
$("#TextBoxSFEDA").maskMoney();
});
</script>
计算代码:
Calculation codes:
protected void TextBoxTA_TextChanged(object sender, EventArgs e)
{
if (!string.IsNullOrEmpty(TextBoxTA.Text) && !string.IsNullOrEmpty(TextBoxTL.Text))
TextBoxTNA.Text = (Convert.ToInt64(TextBoxTA.Text) - Convert.ToInt64(TextBoxTL.Text)).ToString();
TextBoxTL.Focus();
}
protected void TextBoxTUNA_TextChanged(object sender, EventArgs e)
{
if (!string.IsNullOrEmpty(TextBoxTUNA.Text) && !string.IsNullOrEmpty(TextBoxETRNA.Text) && !string.IsNullOrEmpty(TextBoxNPRNA.Text))
TextBoxTNA2.Text = (Convert.ToInt64(TextBoxTUNA.Text) + Convert.ToInt64(TextBoxETRNA.Text) + Convert.ToInt64(TextBoxNPRNA.Text)).ToString();
TextBoxETRNA.Focus();
}
protected void TextBoxETRNA_TextChanged(object sender, EventArgs e)
{
if (!string.IsNullOrEmpty(TextBoxTUNA.Text) && !string.IsNullOrEmpty(TextBoxETRNA.Text) && !string.IsNullOrEmpty(TextBoxNPRNA.Text))
TextBoxTNA2.Text = (Convert.ToInt64(TextBoxTUNA.Text) + Convert.ToInt64(TextBoxETRNA.Text) + Convert.ToInt64(TextBoxNPRNA.Text)).ToString();
TextBoxNPRNA.Focus();
}
protected void TextBoxTL_TextChanged(object sender, EventArgs e)
{
if (!string.IsNullOrEmpty(TextBoxTA.Text) && !string.IsNullOrEmpty(TextBoxTL.Text))
TextBoxTNA.Text = (Convert.ToInt64(TextBoxTA.Text) - Convert.ToInt64(TextBoxTL.Text)).ToString();
TextBoxTUNA.Focus();
}
protected void TextBoxNPRNA_TextChanged(object sender, EventArgs e)
{
if (!string.IsNullOrEmpty(TextBoxTUNA.Text) && !string.IsNullOrEmpty(TextBoxETRNA.Text) && !string.IsNullOrEmpty(TextBoxNPRNA.Text))
TextBoxTNA2.Text = (Convert.ToInt64(TextBoxTUNA.Text) + Convert.ToInt64(TextBoxETRNA.Text) + Convert.ToInt64(TextBoxNPRNA.Text)).ToString();
TextBoxTR.Focus();
}
请帮忙!! 1
Please Help!!1
推荐答案
( document )。ready( function (){
(document).ready(function () {
( #TextBoxTROA)。maskMoney();
("#TextBoxTROA").maskMoney();
( #TextBoxInstr)。maskMoney();
("#TextBoxInstr").maskMoney();
这篇关于如何计算蒙面文本框字段?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文