change comma to point in real-time? 
July 23rd, 2005, 03:56 PM
| | | change comma to point in real-time?
Is it any way to change comma to point when it is typped into the INPUT
field? | 
July 23rd, 2005, 03:56 PM
| | | Re: change comma to point in real-time?
"Piotr" <piou@gaztea.pl> wrote in message
news:nrnapqlwo53q.1hdy14vwwziqf.dlg@40tude.net...[color=blue]
> Is it any way to change comma to point when it is typped into the INPUT
> field?[/color]
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> | 
July 23rd, 2005, 03:56 PM
| | | Re: change comma to point in real-time?
it's this, thank you! | 
July 23rd, 2005, 03:56 PM
| | | Re: change comma to point in real-time?
McKirahan wrote on 12 dec 2004 in comp.lang.javascript:
[color=blue]
> function commadot(that) {
> if (that.value.indexOf(",") >= 0) {
> that.value = that.value.replace(/\,/g,".");
> }
>[/color]
function commadot(that) {
that.value = that.value.replace(/,/g,".");
}
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress) | 
July 23rd, 2005, 03:57 PM
| | | Re: change comma to point in real-time?
"Evertjan." <exjxw.hannivoort@interxnl.net> wrote in message
news:Xns95BDC84A26524eejj99@194.109.133.29...[color=blue]
> McKirahan wrote on 12 dec 2004 in comp.lang.javascript:
>[color=green]
> > function commadot(that) {
> > if (that.value.indexOf(",") >= 0) {
> > that.value = that.value.replace(/\,/g,".");
> > }
> >[/color]
>
> function commadot(that) {
> that.value = that.value.replace(/,/g,".");
> }
>
>
> --
> Evertjan.
> The Netherlands.
> (Please change the x'es to dots in my emailaddress)[/color]
<html>
<head>
<title>comadot.htm</title>
</head>
<body>
<form>
<input type="text" name="txt" onkeyup="this.value =
this.value.replace(/,/g,'.')">
</form>
</body>
</html> | 
July 23rd, 2005, 03:57 PM
| | | Re: change comma to point in real-time?
McKirahan wrote on 12 dec 2004 in comp.lang.javascript:
[color=blue]
> <input type="text" name="txt" onkeyup="this.value =
> this.value.replace(/,/g,'.')">
>[/color]
<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) | | Thread Tools | Search this Thread | | | |
Posting Rules
| You may not post new threads You may not post replies You may not post attachments You may not edit your posts HTML code is Off | | | | | | What is Bytes?
We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights.
Get the best answers to your questions from over 220,662 network members.
|