473,406 Members | 2,620 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,406 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 20894
"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: 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
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.