This forum is no longer open and is for reading/searching only.
Please use our new MachForm Community Forum instead.
MachForm Community Forums » MachForm 3
custom javascript to formfield
Started 12 years ago by paulopdenkelder | 2 posts |
-
I want to add a custom javascript to a formfield (number).
In a number field I would like to change comma's into dots directly when typed. So when someone types 30,4 it changes to 30.4 automatically.This is the javascript:
<script type="text/javascript">
function commadot(that) {
if (that.value.indexOf(",") >= 0) {
that.value = that.value.replace(/\,/g,".");
}
}
</script>Where can I place this script?
To the formfield itself I guess I have to add something like: onkeyup="commadot(this)
Where to add this?
Posted 12 years ago # -
I figured it out...found some related advice in other posts!...
Posted 12 years ago #
Reply
You must log in to post.