Subject: RE: date and number formats
I was about to post a very similar answer, but finally decided, that this is not what rick wants to hear. But it is still true. There WILL be times when this logic fails and then they’ll send you fishing (to stay in the picture).
If anything, you might (and just might!) get away with JavaScript functions. However, the client does not support the more usefull events like onKeyPress, onKeyUp or onKeyDown, so you are limited to onChange, which will not fire until you enter the next field of refresh the form. A basic version - without any error checking, so don’t even think about using it as is - could look like so for the date fields:
var thisValue = this.value;
var month = thisValue.substring(0, 2);
var day = thisValue.substring(2, 4);
var year = thisValue.substring(4, 6);
var newValue = month + “/” + day + “/” + year;
this.value = newValue;
The one advantage over a native input translation is, that you could still use this in a Date field.
A more fancy approach could be to start a call to a function that recursively calls itself every XX milliseconds in onFocus and stop that function in onBlur. This function would have to check the current value of the field, apply error checking and “input translation” and call itself using setTimeOut().
But again, this is not a recommendation. I’d rather suggest to stay away from it, if you can.