文本框计算 [英] Textbox calculation

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

问题描述




i垂直有4个文本框,因为在前3个文本框中我正在输入时间格式的值HH:MM:SS。时间格式后不是上午/下午。


例如:文本框只能接受时间格式为23:00:00。


现在在textbox4中我需要计算上述3个文本框的平均值,即3个文本框的时间格式的平均值,采用HH:MM:SS格式。


一次我来自第3个文本框,3个文本框的平均值在第4个文本框中有2个显示。


Plz为我提供代码或javascript .......


Plz帮助我........


Rgds,


Nusrath。

Hi ,

i have 4 textbox''s vertically , in that in first 3 textbox''s i am entering values in time formati.e in HH:MM:SS .There is no am/pm after time format.

for ex : a textbox has to accept only time format as 23:00:00 .

Now in textbox4 i need to calculate average of the above 3 textbox''s i.e average of 3 textbox''s time format whihc is in HH:MM:SS format.

once i comeout of 3rd textbox the average of above 3 textbox''s has 2 display in 4th textbox.

Plz provide me code or javascript.......

Plz help me ........

Rgds,

Nusrath.

推荐答案

使用 split 方法使用:分隔文本框中的字符串值作为分隔符。


使用结果数组计算平均值。
Use the split method to split the string value from the textbox using ":" as the delimiter.

Use the resulting array to calculate the average.





i有4个文本框垂直,因为在前3个文本框中我正在输入时间形式的值,在HH:MM:SS。时间格式之后没有上午/下午。


for ex:文本框只能接受时间格式为23:00:00。


现在在textbox4中我需要计算上述3个文本框的平均值即3个文本框的时间格式的平均值为HH:MM:SS格式。


一旦我出现第3个文本框,则3个文本框的平均值有2个显示在第4个文本框中。


在第4个文本框中,平均值也必须以时间格式显示,即在HH:MM:SS。


Plz提供我的代码或javascript .......


Plz帮助我........




Rgds,


Nussu。
Hi ,

i have 4 textbox''s vertically , in that in first 3 textbox''s i am entering values in time formati.e in HH:MM:SS .There is no am/pm after time format.

for ex : a textbox has to accept only time format as 23:00:00 .

Now in textbox4 i need to calculate average of the above 3 textbox''s i.e average of 3 textbox''s time format whihc is in HH:MM:SS format.

once i comeout of 3rd textbox the average of above 3 textbox''s has 2 display in 4th textbox.

In 4th textbox the average also has to fisplay in time format only i.e in HH:MM:SS.

Plz provide me code or javascript.......

Plz help me ........




Rgds,

Nussu.


你已经问过这3次了天。


您的问题没有得到解答的原因是因为很明显您在使用javascript编码方面缺乏知识。


我们在tsDN上不是为您提供完整的代码;我们在这里为您提供帮助,并在正确的方向上给您一个推动(在您的情况下是一个踢)。


请阅读一些教程,很多都可以在大型互联网上找到,并亲自尝试。


mark。
You''ve asked this 3times in as less days.

The reason your question isn''t getting answered is because it is clear you lack any knowlege in coding with javascript.

We, at tsDN, are not here to provide you with complete code; we are here to assist you and give you a push(in your case a kick) in the right direction.

Please go read some tutorials, many can be found on the big interwebs, and try it yourself.

mark.


这篇关于文本框计算的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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