473,388 Members | 981 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

change comma to point in real-time?

Is it any way to change comma to point when it is typped into the INPUT
field?
Jul 23 '05 #1
5 20892
"Piotr" <pi**@gaztea.pl> wrote in message
news:nr****************************@40tude.net...
Is it any way to change comma to point when it is typped into the INPUT
field?


Will this help? Watch for word-wrap.

<html>
<head>
<title>comadot.htm</title>
<script type="text/javascript">
function commadot(that) {
if (that.value.indexOf(",") >= 0) {
that.value = that.value.replace(/\,/g,".");
}
}
</script>
</head>
<body>
<form>
<input type="text" name="txt" onkeyup="commadot(this)">
</form>
</body>
</html>
Jul 23 '05 #2
it's this, thank you!
Jul 23 '05 #3
McKirahan wrote on 12 dec 2004 in comp.lang.javascript:
function commadot(that) {
if (that.value.indexOf(",") >= 0) {
that.value = that.value.replace(/\,/g,".");
}


function commadot(that) {
that.value = that.value.replace(/,/g,".");
}
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 23 '05 #4
"Evertjan." <ex**************@interxnl.net> wrote in message
news:Xn********************@194.109.133.29...
McKirahan wrote on 12 dec 2004 in comp.lang.javascript:
function commadot(that) {
if (that.value.indexOf(",") >= 0) {
that.value = that.value.replace(/\,/g,".");
}


function commadot(that) {
that.value = that.value.replace(/,/g,".");
}
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)


<html>
<head>
<title>comadot.htm</title>
</head>
<body>
<form>
<input type="text" name="txt" onkeyup="this.value =
this.value.replace(/,/g,'.')">
</form>
</body>
</html>
Jul 23 '05 #5
McKirahan wrote on 12 dec 2004 in comp.lang.javascript:
<input type="text" name="txt" onkeyup="this.value =
this.value.replace(/,/g,'.')">


<input name="txt" value=""
onkeyup="this.value=this.value.replace(/,/,'.')">

if the value starts at empty,
there never can be more than one comma per keyup,
but for drag-drop and paste, where you were screwed anyway.

one would wish for:

onDragdrop should work only for a window,
and onPaste is nonexistend?

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 23 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Andreas | last post by:
Hi! I'm writing a program that has support for multiple language, so far swedish and english is requested. Everything is fine, but the program has to be able to run on computers with...
2
by: vulcaned | last post by:
Hi All, In AccessXP when another user has the application open I want to change a design or change vba code AccessXP will not let me. It give me the message about it being opened my another user...
4
by: Unknown | last post by:
Does anyone know how I would change the Hue of a bitmap I have? I tried looking for a class that would help me, but all I can find is methods that retrieve Hue values and not change them..
2
by: Wilfried Mestdagh | last post by:
Hi, I have something like this: string S = dblN.ToString("F4") and S contain the decimal point as in the windows setting (currently ',' on this machine). But I want it to be let's say: '.'...
9
by: Wayne | last post by:
I have the following string: "smith", "Joe", "West Palm Beach, Fl." I need to split this string based on the commas, but as you see the city state contains a comma. String.split will spilt the...
6
by: Tommy DN | last post by:
I think I've a simple question. I'm using the datatype "decimal". I need to build a sql - insert statement to save something in the database. But the problem is that the decimal - datatypes are...
6
by: ibiza | last post by:
Hi all, I've binded some data from a DB in a gridview and one of the values is a float. Even if the flot is represented as 4.2 in the DB, it is rendered as 4,2 in the gridview, with a comma....
1
by: ken | last post by:
Hi, How do you change the font for the data labels on your bar graph report/chart? I have 24 series, and when I change the font of the data label for one series that does not change them all......
19
by: M. Posseth | last post by:
Hi ,, i live in Europe in Europe the decimal seperator is , not a . why is it so that if i press on my numeric keypad the . a . appears ?? in my opinion it should be a , ( sounds odd but...
7
by: JohnC | last post by:
Hello people, I thought I was fairly proficient in websearching, but I haven't found a standard on how to encode numerical values in an XML file in a standard way. XML docs do specify character...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.