Hello NG,
I want to write a generic function to validate data in input items.
For this I want to pass a refernce to the object which calls this function
to read out the and modify it if nessescary. For example when having a
date with 2 digits year it will automically changed to 4 digits.
Also I want the opportunity to keep the focus inside this object if
validating fails.
I thought about this:
function GenericCheckDateInput( Inputitem)
{
var datevalue = Inputiten.value;
......... //Check or generate correct date value
Inputitem.value = datevalue;
if (xyz)
Inputitem.focus();
return whateverIwant;
}
<input name="Birthday" type="text" OnBlur="GenericCheckDateInput( this);">
this doesn't work. :-(
What I got running was: (with a corresponding function)
<input name="Birthday" type="text" OnBlur="this.value =
GenericCheckDateInput( this.value);">
But that's not really what I want.
What do I have to do to get the first version running.
Thanks
Ingo