文本框中的货币格式 [英] Currency format in textboxes

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

问题描述

是javascript的新手。

我需要格式化在文本框中输入数字的货币。我可以在计算中格式化货币并在总计中显示,但无法弄清楚如何在输入文本框中进行格式化。



[HTML]<!DOCTYPE HTML PUBLIC" - // W3C // DTD HTML 4.01 Transitional // EN"

" ; http://www.w3.org/TR/html4/loose.dtd">

< html>

< head>

< title> Untitled Document< / title>

< meta http-equiv =" Content-Type"含量=" text / html的; charset = iso-8859-1">


< script language =" javascript" type =" text / javascript">

[/ HTML]

Am new to javascript.
I need to format the currency in the as numbers are entered in textboxes. I can format the currency in the calculations and display in the totals but can not figure out how to format in input textboxes.


[HTML]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<script language="javascript" type="text/javascript">
[/HTML]

展开 | 选择 | Wrap | 行号

推荐答案

欢迎来到TSDN!


您想在每次按键时或在特定文本框中的值更改后格式化吗?
Welcome to TSDN!

Do you want to format on each key press or after the value in a particular text box has changed?



欢迎来到TSDN!


您想要在每次按键时或在特定文本框中的值之后格式化改变了吗?
Welcome to TSDN!

Do you want to format on each key press or after the value in a particular text box has changed?



特定文本框中的值更改后。与移动到下一个文本框后的格式一样。


After the value in a particular text box has changed. As in formatting after moving to next text box.


然后应用货币格式函数onchange:
Then apply the currency format function onchange:
展开 | 选择 | 换行 | 行号


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

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