使用javascript的文本框格式 [英] textbox format using javascript

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

问题描述

我想使用逗号(,)运算符来格式化文本框。

我需要创建一个具有文本框控件的项目,以获取印度卢比作为输入。当用户输入输入时,它应该通过添加逗号运算符自动格式化输入,即ie。此输入的1,00,000是100000.当用户在文本框中输入值时,应自动插入逗号。





你能帮我解答一下..........

I want to eformat the text box by using the comma(,) operator.
I need to create a project that is having a text box control that is to get the indian rupees as input.while the user is entering the input it should automatically format the input by adding the comma operator,that is ie. 1,00,000 for this input is 100000.the comma should be inserted automatically while the user entering the value in the text box.


will you please help me to get the answer ..........

推荐答案

转到这个链接

http://www.integraxor.com/blog/number-formatter-is-now-localized

下载numberformat.js。它的简单插件。支持多种货币格式,非常易于使用。我们一直在使用它的在线零售项目。



如何使用..

将.j添加到您的网站,


模糊文字字段。

Go to this link
http://www.integraxor.com/blog/number-formatter-is-now-localized
download numberformat.js . its simple plug in. supports multiple format of currency, very easy to use. We have been uses it our online retail project.

How to use it..
add .js to your website,

on blur of text field.


' input [id
('input[id


=totalAmount]')。val(格式( ###,###,###。##,amount.toFixed ( 2 )));
="totalAmount"]').val(format("###,###,###.##",amount.toFixed(2)));





计算金额替换和其他分隔符。



on calculation of amount replace , and other separator.

var temp=(


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

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