在javascript中简单计算(添加) [英] Simple calculation (adding) in javascript

查看:43
本文介绍了在javascript中简单计算(添加)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,


如果没有

提交按钮,我应该怎么做这个简单的数据夏天?


与excel表格一样,我希望在

列中有几个单元格,并且一旦访问者键入数字,总和应该更改,

无论有多少原始和基于设置

(添加,乘以等)。


我会很感激代码,链接到代码或建议。


提前致谢。 :)

Hello,

How the heck should I make this simple summering of a data without a
submit button?

Like in an excel sheet I would like to have a couple of cells in a
column and as soon the visitor types the number the sum should change,
regardless of how many raws there are and based on the setting
(adding, multiplying etc).

I would appreciate the code, link to the code or suggestions.

Thanks in advance. :)

推荐答案

于2007年4月2日在comp.lang.javascript中写道
wrote on 02 apr 2007 in comp.lang.javascript:

您好,


如果没有

提交按钮,我应该怎么做这个简单的数据夏天? ?


就像在excel表中一样,我想在

列中有几个单元格,一旦访问者键入数字,总和就会改变,

,无论有多少原料,并根据设置

(添加,乘以等)。


我会感谢代码,链接到代码或建议。


提前致谢。 :)
Hello,

How the heck should I make this simple summering of a data without a
submit button?

Like in an excel sheet I would like to have a couple of cells in a
column and as soon the visitor types the number the sum should change,
regardless of how many raws there are and based on the setting
(adding, multiplying etc).

I would appreciate the code, link to the code or suggestions.

Thanks in advance. :)



onchange =" ..."


onkeyup =" ...." < br $>



-

Evertjan。

荷兰。

(请将x''es更改为我的电子邮件地址中的点数)

onchange="..."

onkeyup="...."

etc.
--
Evertjan.
The Netherlands.
(Please change the x''es to dots in my emailaddress)


ap ******* @ gmail.com 写道:

您好,


如果没有

提交按钮,我应该怎么做这个简单的数据夏天?


就像在excel表中我希望有几个

列中的单元格,一旦访问者输入总和应该更改的数字,

,无论有多少原始数据并且基于设置

(添加,乘以等)。
Hello,

How the heck should I make this simple summering of a data without a
submit button?

Like in an excel sheet I would like to have a couple of cells in a
column and as soon the visitor types the number the sum should change,
regardless of how many raws there are and based on the setting
(adding, multiplying etc).



您可以使用(on)keypress事件来捕获用户的数字

类型。最简单的方法就是简单写一下


yourInputElement.onkeypress = yourOnkeypressFunction;


其中yourOnkeypressFunction是一个处理事件的函数。


-

Ian Collins。

You can use the (on)keypress event to capture the numbers the user
types. The easiest way is to simple write

yourInputElement.onkeypress = yourOnkeypressFunction;

where yourOnkeypressFunction is a function that processes the event.

--
Ian Collins.


4月2日00:34,Ian Collins< ian -n ... @ hotmail.comwrote:
On 2 Apr, 00:34, Ian Collins <ian-n...@hotmail.comwrote:

ap.sak ... @ gmail.com写道:
ap.sak...@gmail.com wrote:

您好,
Hello,


如果没有

提交按钮,我应该如何简单地模拟数据? ?
How the heck should I make this simple summering of a data without a
submit button?


在excel表格中我希望在

列中有几个单元格,并且访问者很快键入总和应该更改的数字,

,无论有多少原始数据,并根据设置

(添加,乘以等)。
Like in an excel sheet I would like to have a couple of cells in a
column and as soon the visitor types the number the sum should change,
regardless of how many raws there are and based on the setting
(adding, multiplying etc).



您可以使用(on)keypress事件来捕获用户

类型的数字。最简单的方法就是简单写一下


yourInputElement.onkeypress = yourOnkeypressFunction;


其中yourOnkeypressFunction是一个处理事件的函数。


-

伊恩柯林斯。


You can use the (on)keypress event to capture the numbers the user
types. The easiest way is to simple write

yourInputElement.onkeypress = yourOnkeypressFunction;

where yourOnkeypressFunction is a function that processes the event.

--
Ian Collins.



谢谢,但我很感激这个例子。


有谁知道脚本在哪里工作?


Thanks but I would appreciate the exempel.

Does anyone knows of the script where this is working?


这篇关于在javascript中简单计算(添加)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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