想要将表单输入自动添加到总计中。 [英] Want to auto-add form inputs to a grand total.

查看:78
本文介绍了想要将表单输入自动添加到总计中。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以帮我修改这个以用于将来的Usenet档案并帮助

我解决我不知道的事情吗?


<表格名称= QUOT; addform"方法= QUOT; POST" action =" ./ submit.php">

< input type =" text" name =" Box 1"大小= QUOT; 20"值= QUOT; 100.50"> +

< input type =" text" name =" Box 2"大小= QUOT; 20"值= QUOT; 200.50"> +

< input type =" text" name =" Box 3"大小= QUOT; 20"值= QUOT; 1.50"> =

< input type =" text"名称= QUOT;总计"大小= QUOT; 20"值= QUOT; 302.50"> < / p>

< / form>


我希望有人能够在Box 1,2中动态输入任何数字,2

和3,它在总计框中自动计算总数 - 所有这些都没有按

a"计算"按钮。非常感谢任何人的天才和帮助!

Can someone help me modify this for future Usenet archival and to help
me solve what I don''t know?

<form name="addform" method="POST" action="./submit.php">
<input type="text" name="Box 1" size="20" value="100.50"> +
<input type="text" name="Box 2" size="20" value="200.50"> +
<input type="text" name="Box 3" size="20" value="1.50"> =
<input type="text" name="Total" size="20" value="302.50"> </p>
</form>

I want someone to be able to dynamically type any number in Box 1, 2
and 3 and it autosum the total on the Total box -- all without pressing
a "calculate" button. Thank you so much for anyone''s genius and help!

推荐答案

gi ****************** @ gmail.com 说如下在2005年12月10日下午8:45:
gi******************@gmail.com said the following on 10/12/2005 8:45 PM:
有人可以帮我修改这个以用于将来的Usenet档案并帮助我解决我不知道的事情吗?


为什么?它已经解决了。在过去这么多次,已经为那些愿意寻找答案的人存档了。

< form name =" addform"方法= QUOT; POST" action =" ./ submit.php">
< input type =" text" name =" Box 1"大小= QUOT; 20"值= QUOT; 100.50"> +
< input type =" text" name =" Box 2"大小= QUOT; 20"值= QUOT; 200.50"> +
< input type =" text" name =" Box 3"大小= QUOT; 20"值= QUOT; 1.50"> =
< input type =" text"名称= QUOT;总计"大小= QUOT; 20"值= QUOT; 302.50"> < / p>
< / form>

我希望有人能够动态输入方框1,2中的任何数字,然后自动输入总数总计框 - 所有没有按下
a计算按钮。非常感谢任何人的天才和帮助!
Can someone help me modify this for future Usenet archival and to help
me solve what I don''t know?
Why? It has been "solved" so many times in the past and is already
archived for those willing to search for the answer.
<form name="addform" method="POST" action="./submit.php">
<input type="text" name="Box 1" size="20" value="100.50"> +
<input type="text" name="Box 2" size="20" value="200.50"> +
<input type="text" name="Box 3" size="20" value="1.50"> =
<input type="text" name="Total" size="20" value="302.50"> </p>
</form>

I want someone to be able to dynamically type any number in Box 1, 2
and 3 and it autosum the total on the Total box -- all without pressing
a "calculate" button. Thank you so much for anyone''s genius and help!




搜索档案,答案已经存在。


-

兰迪

comp.lang.javascript常见问题 - http://jibbering.com/faq &新闻组周刊



Search the archives, the answers are already there.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly


我进行了第二次Google搜索。我的意思是一个工作的例子。我仍然会找到关于这个主题的讨论,但没有什么可以帮助我作为一个完整的

新手。我希望有人可以帮助我。如果我错过了某些东西

那么请原谅这个回复。谢谢。


Carly

I ran a second Google search. What I mean is a working example. I still
find discussions about the topic, but nothing helping me as a complete
novice. I''m hoping someone can help me. If I missed something out there
then please forgive this response. Thank you.

Carly


gi ****************** @ gmail.com 以下10 /表示12/2005 11:21 PM:
gi******************@gmail.com said the following on 10/12/2005 11:21 PM:
我进行了第二次Google搜索。


Google搜索网络或comp.lang.javascript的存档搜索?

我的意思是一个有效的例子。我仍然找到关于
主题的讨论,但没有任何帮助我作为一个完整的新手。我希望有人可以帮助我。如果我遗漏了一些内容,请原谅这个
回复。


< form name =" addform"方法= QUOT; POST" action =" ./ submit.php">

< input type =" text"名称= QUOT; BOX1"大小= QUOT; 20" value =" 100.50"

onchange =" totalIt(this.form)"> +

< input type =" text"名称= QUOT; BOX2"大小= QUOT; 20" value =" 200.50"

onchange =" totalIt(this.form)"> +

< input type =" text"名称= QUOT; BOX3"大小= QUOT; 20" value =" 1.50"

onchange =" totalIt(this.form)">

< input type =" text"名称= QUOT;总计"大小= QUOT; 20"值= QUOT; 302.50"> < / p>

< / form>

< script type =" text / javascript">

function totalIt( formObj){

formObj.Total.value =(+ formObj.Box1.value)+(+ formOb j.Box2.value)+(+ formObj.Box3.value);

}

< / script>


注意:我在名称中没有空格重命名您的输入,以便我可以

使用点符号。


< URL:
http://groups.google.com /group/micro...6bd95dc8513417
I ran a second Google search.
A Google search of the web or an archive search of comp.lang.javascript?
What I mean is a working example. I still find discussions about the
topic, but nothing helping me as a complete novice. I''m hoping someone
can help me. If I missed something out there then please forgive this
response.
<form name="addform" method="POST" action="./submit.php">
<input type="text" name="Box1" size="20" value="100.50"
onchange="totalIt(this.form)"> +
<input type="text" name="Box2" size="20" value="200.50"
onchange="totalIt(this.form)"> +
<input type="text" name="Box3" size="20" value="1.50"
onchange="totalIt(this.form)">
<input type="text" name="Total" size="20" value="302.50"> </p>
</form>
<script type="text/javascript">
function totalIt(formObj){
formObj.Total.value=(+formObj.Box1.value)+(+formOb j.Box2.value)+(+formObj.Box3.value);
}
</script>

Note: I renamed your inputs without spaces in the name so that I could
use the dot notation.

<URL:
http://groups.google.com/group/micro...6bd95dc8513417




也会给你一些很好的阅读。


请引用您要回复的内容。


如果您想通过groups.google.com发布后续内容,请不要使用

回复。链接在文章的底部。点击显示选项在

文章的顶部,然后点击回复。在

文章标题的底部。


-

Randy

comp.lang .javascript常见问题解答 - http://jibbering.com/faq &新闻组每周

答:它会破坏对话的顺序

问题:为什么?

答案:热门发布。

问题:Usenet上最烦人的事情是什么?



will give you some good reading also.

Please quote what you are replying to.

If you want to post a followup via groups.google.com, don''t use the
"Reply" link at the bottom of the article. Click on "show options" at
the top of the article, then click on the "Reply" at the bottom of the
article headers.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Answer:It destroys the order of the conversation
Question: Why?
Answer: Top-Posting.
Question: Whats the most annoying thing on Usenet?


这篇关于想要将表单输入自动添加到总计中。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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